OLD | NEW |
---|---|
(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 when 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 when the WebState at the specified index is moved to another index. | |
rohitrao (ping after 24h)
2017/02/13 20:54:29
Is this called before or after the move? Is that
sdefresne
2017/02/14 13:39:57
After, I've updated the documentation.
| |
29 virtual void WebStateMoved(WebStateList* web_state_list, | |
30 web::WebState* web_state, | |
31 size_t from_index, | |
32 size_t to_index) = 0; | |
33 | |
34 // Invoked when the WebState at the specified index is replaced by another | |
rohitrao (ping after 24h)
2017/02/13 20:54:29
Is this called before or after the replacement? I
sdefresne
2017/02/14 13:39:57
After, I've updated the documentation.
| |
35 // WebState. | |
36 virtual void WebStateReplacedAt(WebStateList* web_state_list, | |
37 web::WebState* old_web_state, | |
38 web::WebState* new_web_state, | |
39 size_t index) = 0; | |
40 | |
41 // Invoked when the WebState at the specified index is being removed. The | |
42 // WebState is still valid but is no longer in the WebStateList. | |
43 virtual void WebStateRemovedAt(WebStateList* web_state_list, | |
rohitrao (ping after 24h)
2017/02/13 20:54:29
Is there value in calling this "Detached" instead
sdefresne
2017/02/14 13:39:57
Done.
| |
44 web::WebState* web_state, | |
45 size_t index) = 0; | |
46 | |
47 private: | |
48 DISALLOW_COPY_AND_ASSIGN(WebStateListObserver); | |
49 }; | |
50 | |
51 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ | |
OLD | NEW |