-
Notifications
You must be signed in to change notification settings - Fork 6.6k
/
inactive_tabs_mediator.h
56 lines (44 loc) · 2.07 KB
/
inactive_tabs_mediator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_GRID_INACTIVE_TABS_INACTIVE_TABS_MEDIATOR_H_
#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_GRID_INACTIVE_TABS_INACTIVE_TABS_MEDIATOR_H_
#import <Foundation/Foundation.h>
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_commands.h"
@protocol InactiveTabsInfoConsumer;
class PrefService;
class SnapshotBrowserAgent;
class SessionRestorationBrowserAgent;
@protocol TabCollectionConsumer;
class WebStateList;
namespace sessions {
class TabRestoreService;
} // namespace sessions
// This mediator provides data to the Inactive Tabs grid and handles
// interactions.
@interface InactiveTabsMediator : NSObject <GridCommands>
// `consumer` receives `webStateList` and Inactive Tabs info updates.
@property(nonatomic, weak) id<TabCollectionConsumer, InactiveTabsInfoConsumer>
consumer;
// Initializer with:
// - `webStateList`: the list of tabs to observe.
// - `prefService`: the preference service from the application context.
// - `sessionRestorationAgent`: the session restoration browser agent from the
// inactive browser.
// - `snapshotAgent`: the snapshot browser agent from the inactive browser.
// - `tabRestoreService`: the service that holds the recently closed tabs.
- (instancetype)initWithWebStateList:(WebStateList*)webStateList
prefService:(PrefService*)prefService
sessionRestorationAgent:
(SessionRestorationBrowserAgent*)sessionRestorationAgent
snapshotAgent:(SnapshotBrowserAgent*)snapshotAgent
tabRestoreService:
(sessions::TabRestoreService*)tabRestoreService
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
// Returns the number of items pushed to the consumer.
- (NSInteger)numberOfItems;
// Disconnects the mediator.
- (void)disconnect;
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_GRID_INACTIVE_TABS_INACTIVE_TABS_MEDIATOR_H_