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

Unified Diff: ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h

Issue 2770223003: [ios] Switches ToolbarModelDelegateIOS to use WebStateList. (Closed)
Patch Set: Fix compile. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698