OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ | 5 #ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ |
6 #define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ | 6 #define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
10 class WebStateList; | 10 class WebStateList; |
(...skipping 21 matching lines...) Expand all Loading... |
32 int from_index, | 32 int from_index, |
33 int to_index); | 33 int to_index); |
34 | 34 |
35 // Invoked after the WebState at the specified index is replaced by another | 35 // Invoked after the WebState at the specified index is replaced by another |
36 // WebState. | 36 // WebState. |
37 virtual void WebStateReplacedAt(WebStateList* web_state_list, | 37 virtual void WebStateReplacedAt(WebStateList* web_state_list, |
38 web::WebState* old_web_state, | 38 web::WebState* old_web_state, |
39 web::WebState* new_web_state, | 39 web::WebState* new_web_state, |
40 int index); | 40 int index); |
41 | 41 |
| 42 // Invoked before the specified WebState is detached from the WebStateList. |
| 43 // The WebState is still valid and still in the WebStateList. |
| 44 virtual void WillDetachWebStateAt(WebStateList* web_state_list, |
| 45 web::WebState* web_state, |
| 46 int index); |
| 47 |
42 // Invoked after the WebState at the specified index has been detached. The | 48 // Invoked after the WebState at the specified index has been detached. The |
43 // WebState is still valid but is no longer in the WebStateList. | 49 // WebState is still valid but is no longer in the WebStateList. |
44 virtual void WebStateDetachedAt(WebStateList* web_state_list, | 50 virtual void WebStateDetachedAt(WebStateList* web_state_list, |
45 web::WebState* web_state, | 51 web::WebState* web_state, |
46 int index); | 52 int index); |
47 | 53 |
| 54 // Invoked before the specified WebState is destroyed via the WebStateList. |
| 55 // The WebState is still valid but is no longer in the WebStateList. |
| 56 virtual void WillCloseWebStateAt(WebStateList* web_state_list, |
| 57 web::WebState* web_state, |
| 58 int index); |
| 59 |
48 // Invoked after |new_web_state| was activated at the specified index. Both | 60 // Invoked after |new_web_state| was activated at the specified index. Both |
49 // WebState are either valid or null (if there was no selection or there is | 61 // WebState are either valid or null (if there was no selection or there is |
50 // no selection). If the change is due to an user action, |user_action| will | 62 // no selection). If the change is due to an user action, |user_action| will |
51 // be true. | 63 // be true. |
52 virtual void WebStateActivatedAt(WebStateList* web_state_list, | 64 virtual void WebStateActivatedAt(WebStateList* web_state_list, |
53 web::WebState* old_web_state, | 65 web::WebState* old_web_state, |
54 web::WebState* new_web_state, | 66 web::WebState* new_web_state, |
55 int active_index, | 67 int active_index, |
56 bool user_action); | 68 bool user_action); |
57 | 69 |
58 private: | 70 private: |
59 DISALLOW_COPY_AND_ASSIGN(WebStateListObserver); | 71 DISALLOW_COPY_AND_ASSIGN(WebStateListObserver); |
60 }; | 72 }; |
61 | 73 |
62 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ | 74 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_OBSERVER_H_ |
OLD | NEW |