Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: ios/shared/chrome/browser/tabs/web_state_list_observer.h

Issue 2680403005: Introduce WebStateList to manage a list of web::WebState. (Closed)
Patch Set: Rebase && address comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_
6 #define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_
7
8 #include "base/macros.h"
9
10 class WebStateList;
11
12 namespace web {
13 class WebState;
14 }
15
16 // Interface for listening to events occurring to WebStateLists.
17 class WebStateListObserver {
18 public:
19 WebStateListObserver() = default;
20 virtual ~WebStateListObserver() = default;
21
22 // Invoked after a new WebState has been added to the WebStateList at the
23 // specified index.
24 virtual void WebStateInsertedAt(WebStateList* web_state_list,
25 web::WebState* web_state,
26 size_t index) = 0;
27
28 // Invoked after the WebState at the specified index is moved to another
29 // index.
30 virtual void WebStateMoved(WebStateList* web_state_list,
31 web::WebState* web_state,
32 size_t from_index,
33 size_t to_index) = 0;
34
35 // Invoked after the WebState at the specified index is replaced by another
36 // WebState.
37 virtual void WebStateReplacedAt(WebStateList* web_state_list,
38 web::WebState* old_web_state,
39 web::WebState* new_web_state,
40 size_t index) = 0;
41
42 // Invoked after the WebState at the specified index is being detached. The
rohitrao (ping after 24h) 2017/02/14 13:49:31 "has been detached"
sdefresne 2017/02/14 15:26:35 Done.
43 // WebState is still valid but is no longer in the WebStateList.
44 virtual void WebStateDetachedAt(WebStateList* web_state_list,
45 web::WebState* web_state,
46 size_t index) = 0;
47
48 private:
49 DISALLOW_COPY_AND_ASSIGN(WebStateListObserver);
50 };
51
52 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698