Index: ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h |
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h |
index 1da6a5d14dd7276d9f1d178d371572368703345a..bf0a8002b4a926b29f962f43b54c911f49ed340d 100644 |
--- a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h |
+++ b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h |
@@ -9,25 +9,27 @@ |
#include "base/macros.h" |
#include "components/toolbar/toolbar_model_delegate.h" |
-@class Tab; |
-@class TabModel; |
+class WebStateList; |
namespace web { |
class NavigationItem; |
+class WebState; |
} |
// Implementation of ToolbarModelDelegate which uses an instance of |
// TabModel in order to fulfil its duties. |
class ToolbarModelDelegateIOS : public ToolbarModelDelegate { |
public: |
- explicit ToolbarModelDelegateIOS(TabModel* tab_model); |
+ // |web_state_list| must outlive this ToolbarModelDelegateIOS object. |
+ explicit ToolbarModelDelegateIOS(WebStateList* web_state_list); |
~ToolbarModelDelegateIOS() override; |
- // Sets the |tab_model_| with provided values. |
- void SetTabModel(TabModel* tab_model); |
+ // Sets the |web_state_list_| with provided values. |web_state_list| must |
+ // outlive this ToolbarModelDelegateIOS object. |
+ void SetWebStateList(WebStateList* web_state_list); |
- // Returns the current tab. |
- Tab* GetCurrentTab() const; |
+ // Returns the active WebState. |
+ web::WebState* GetActiveWebState() const; |
private: |
// Helper method to extract the NavigationItem from which the states are |
@@ -46,7 +48,7 @@ class ToolbarModelDelegateIOS : public ToolbarModelDelegate { |
bool FailsMalwareCheck() const override; |
const gfx::VectorIcon* GetVectorIconOverride() const override; |
- base::scoped_nsobject<TabModel> tab_model_; |
+ WebStateList* web_state_list_; // weak |
DISALLOW_COPY_AND_ASSIGN(ToolbarModelDelegateIOS); |
}; |