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_DELEGATE_H_ |
| 6 #define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_DELEGATE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 |
| 10 namespace web { |
| 11 class WebState; |
| 12 } |
| 13 |
| 14 // A delegate interface that the WebStateList uses to perform work that it |
| 15 // cannot do itself such as attaching tab helpers, ... |
| 16 class WebStateListDelegate { |
| 17 public: |
| 18 WebStateListDelegate() = default; |
| 19 virtual ~WebStateListDelegate() = default; |
| 20 |
| 21 // Notifies the delegate that the specified WebState will be added to the |
| 22 // WebStateList (via insertion/appending/replacing existing) and allows it |
| 23 // to do any preparation that it deems necessary. |
| 24 virtual void WillAddWebState(web::WebState* web_state) = 0; |
| 25 |
| 26 // Notifies the delegate that the specified WebState has been detached from |
| 27 // the WebStateList (via detaching/closing/replacing existing) and allows it |
| 28 // to do any clean up that it deems necessary. |
| 29 virtual void WebStateDetached(web::WebState* web_state) = 0; |
| 30 |
| 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(WebStateListDelegate); |
| 33 }; |
| 34 |
| 35 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_DELEGATE_H_ |
OLD | NEW |