OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 TabStripModel* model() const { return model_; } | 39 TabStripModel* model() const { return model_; } |
40 | 40 |
41 bool IsCommandEnabledForTab(TabStripModel::ContextMenuCommand command_id, | 41 bool IsCommandEnabledForTab(TabStripModel::ContextMenuCommand command_id, |
42 Tab* tab) const; | 42 Tab* tab) const; |
43 void ExecuteCommandForTab(TabStripModel::ContextMenuCommand command_id, | 43 void ExecuteCommandForTab(TabStripModel::ContextMenuCommand command_id, |
44 Tab* tab); | 44 Tab* tab); |
45 bool IsTabPinned(Tab* tab) const; | 45 bool IsTabPinned(Tab* tab) const; |
46 | 46 |
47 // TabStripController implementation: | 47 // TabStripController implementation: |
48 virtual const ui::ListSelectionModel& GetSelectionModel() OVERRIDE; | 48 virtual const ui::ListSelectionModel& GetSelectionModel() override; |
49 virtual int GetCount() const OVERRIDE; | 49 virtual int GetCount() const override; |
50 virtual bool IsValidIndex(int model_index) const OVERRIDE; | 50 virtual bool IsValidIndex(int model_index) const override; |
51 virtual bool IsActiveTab(int model_index) const OVERRIDE; | 51 virtual bool IsActiveTab(int model_index) const override; |
52 virtual int GetActiveIndex() const OVERRIDE; | 52 virtual int GetActiveIndex() const override; |
53 virtual bool IsTabSelected(int model_index) const OVERRIDE; | 53 virtual bool IsTabSelected(int model_index) const override; |
54 virtual bool IsTabPinned(int model_index) const OVERRIDE; | 54 virtual bool IsTabPinned(int model_index) const override; |
55 virtual bool IsNewTabPage(int model_index) const OVERRIDE; | 55 virtual bool IsNewTabPage(int model_index) const override; |
56 virtual void SelectTab(int model_index) OVERRIDE; | 56 virtual void SelectTab(int model_index) override; |
57 virtual void ExtendSelectionTo(int model_index) OVERRIDE; | 57 virtual void ExtendSelectionTo(int model_index) override; |
58 virtual void ToggleSelected(int model_index) OVERRIDE; | 58 virtual void ToggleSelected(int model_index) override; |
59 virtual void AddSelectionFromAnchorTo(int model_index) OVERRIDE; | 59 virtual void AddSelectionFromAnchorTo(int model_index) override; |
60 virtual void CloseTab(int model_index, CloseTabSource source) OVERRIDE; | 60 virtual void CloseTab(int model_index, CloseTabSource source) override; |
61 virtual void ToggleTabAudioMute(int model_index) OVERRIDE; | 61 virtual void ToggleTabAudioMute(int model_index) override; |
62 virtual void ShowContextMenuForTab(Tab* tab, | 62 virtual void ShowContextMenuForTab(Tab* tab, |
63 const gfx::Point& p, | 63 const gfx::Point& p, |
64 ui::MenuSourceType source_type) OVERRIDE; | 64 ui::MenuSourceType source_type) override; |
65 virtual void UpdateLoadingAnimations() OVERRIDE; | 65 virtual void UpdateLoadingAnimations() override; |
66 virtual int HasAvailableDragActions() const OVERRIDE; | 66 virtual int HasAvailableDragActions() const override; |
67 virtual void OnDropIndexUpdate(int index, bool drop_before) OVERRIDE; | 67 virtual void OnDropIndexUpdate(int index, bool drop_before) override; |
68 virtual void PerformDrop(bool drop_before, | 68 virtual void PerformDrop(bool drop_before, |
69 int index, | 69 int index, |
70 const GURL& url) OVERRIDE; | 70 const GURL& url) override; |
71 virtual bool IsCompatibleWith(TabStrip* other) const OVERRIDE; | 71 virtual bool IsCompatibleWith(TabStrip* other) const override; |
72 virtual void CreateNewTab() OVERRIDE; | 72 virtual void CreateNewTab() override; |
73 virtual void CreateNewTabWithLocation(const base::string16& loc) OVERRIDE; | 73 virtual void CreateNewTabWithLocation(const base::string16& loc) override; |
74 virtual bool IsIncognito() OVERRIDE; | 74 virtual bool IsIncognito() override; |
75 virtual void StackedLayoutMaybeChanged() OVERRIDE; | 75 virtual void StackedLayoutMaybeChanged() override; |
76 virtual void OnStartedDraggingTabs() OVERRIDE; | 76 virtual void OnStartedDraggingTabs() override; |
77 virtual void OnStoppedDraggingTabs() OVERRIDE; | 77 virtual void OnStoppedDraggingTabs() override; |
78 virtual void CheckFileSupported(const GURL& url) OVERRIDE; | 78 virtual void CheckFileSupported(const GURL& url) override; |
79 | 79 |
80 // TabStripModelObserver implementation: | 80 // TabStripModelObserver implementation: |
81 virtual void TabInsertedAt(content::WebContents* contents, | 81 virtual void TabInsertedAt(content::WebContents* contents, |
82 int model_index, | 82 int model_index, |
83 bool is_active) OVERRIDE; | 83 bool is_active) override; |
84 virtual void TabDetachedAt(content::WebContents* contents, | 84 virtual void TabDetachedAt(content::WebContents* contents, |
85 int model_index) OVERRIDE; | 85 int model_index) override; |
86 virtual void TabSelectionChanged( | 86 virtual void TabSelectionChanged( |
87 TabStripModel* tab_strip_model, | 87 TabStripModel* tab_strip_model, |
88 const ui::ListSelectionModel& old_model) OVERRIDE; | 88 const ui::ListSelectionModel& old_model) override; |
89 virtual void TabMoved(content::WebContents* contents, | 89 virtual void TabMoved(content::WebContents* contents, |
90 int from_model_index, | 90 int from_model_index, |
91 int to_model_index) OVERRIDE; | 91 int to_model_index) override; |
92 virtual void TabChangedAt(content::WebContents* contents, | 92 virtual void TabChangedAt(content::WebContents* contents, |
93 int model_index, | 93 int model_index, |
94 TabChangeType change_type) OVERRIDE; | 94 TabChangeType change_type) override; |
95 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 95 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
96 content::WebContents* old_contents, | 96 content::WebContents* old_contents, |
97 content::WebContents* new_contents, | 97 content::WebContents* new_contents, |
98 int model_index) OVERRIDE; | 98 int model_index) override; |
99 virtual void TabPinnedStateChanged(content::WebContents* contents, | 99 virtual void TabPinnedStateChanged(content::WebContents* contents, |
100 int model_index) OVERRIDE; | 100 int model_index) override; |
101 virtual void TabMiniStateChanged(content::WebContents* contents, | 101 virtual void TabMiniStateChanged(content::WebContents* contents, |
102 int model_index) OVERRIDE; | 102 int model_index) override; |
103 virtual void TabBlockedStateChanged(content::WebContents* contents, | 103 virtual void TabBlockedStateChanged(content::WebContents* contents, |
104 int model_index) OVERRIDE; | 104 int model_index) override; |
105 | 105 |
106 protected: | 106 protected: |
107 // The context in which SetTabRendererDataFromModel is being called. | 107 // The context in which SetTabRendererDataFromModel is being called. |
108 enum TabStatus { | 108 enum TabStatus { |
109 NEW_TAB, | 109 NEW_TAB, |
110 EXISTING_TAB | 110 EXISTING_TAB |
111 }; | 111 }; |
112 | 112 |
113 // Sets the TabRendererData from the TabStripModel. | 113 // Sets the TabRendererData from the TabStripModel. |
114 virtual void SetTabRendererDataFromModel(content::WebContents* contents, | 114 virtual void SetTabRendererDataFromModel(content::WebContents* contents, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; | 165 scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; |
166 | 166 |
167 PrefChangeRegistrar local_pref_registrar_; | 167 PrefChangeRegistrar local_pref_registrar_; |
168 | 168 |
169 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; | 169 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; |
170 | 170 |
171 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); | 171 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); |
172 }; | 172 }; |
173 | 173 |
174 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 174 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |