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

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

Issue 2770223003: [ios] Switches ToolbarModelDelegateIOS to use WebStateList. (Closed)
Patch Set: Review 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
« no previous file with comments | « ios/chrome/browser/ui/toolbar/BUILD.gn ('k') | ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0a196a8a5dd92d6833c2dae46bcc53b43b864b02 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,23 @@
#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);
-
- // 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 +44,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);
};
« no previous file with comments | « ios/chrome/browser/ui/toolbar/BUILD.gn ('k') | ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698