| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void PerformDrop(bool drop_before, int index, const GURL& url) override; | 69 void PerformDrop(bool drop_before, int index, const GURL& url) override; |
| 70 bool IsCompatibleWith(TabStrip* other) const override; | 70 bool IsCompatibleWith(TabStrip* other) const override; |
| 71 void CreateNewTab() override; | 71 void CreateNewTab() override; |
| 72 void CreateNewTabWithLocation(const base::string16& loc) override; | 72 void CreateNewTabWithLocation(const base::string16& loc) override; |
| 73 bool IsIncognito() override; | 73 bool IsIncognito() override; |
| 74 void StackedLayoutMaybeChanged() override; | 74 void StackedLayoutMaybeChanged() override; |
| 75 void OnStartedDraggingTabs() override; | 75 void OnStartedDraggingTabs() override; |
| 76 void OnStoppedDraggingTabs() override; | 76 void OnStoppedDraggingTabs() override; |
| 77 void CheckFileSupported(const GURL& url) override; | 77 void CheckFileSupported(const GURL& url) override; |
| 78 SkColor GetToolbarTopSeparatorColor() const override; | 78 SkColor GetToolbarTopSeparatorColor() const override; |
| 79 base::string16 GetAccessibleTabName() const override; |
| 79 | 80 |
| 80 // TabStripModelObserver implementation: | 81 // TabStripModelObserver implementation: |
| 81 void TabInsertedAt(TabStripModel* tab_strip_model, | 82 void TabInsertedAt(TabStripModel* tab_strip_model, |
| 82 content::WebContents* contents, | 83 content::WebContents* contents, |
| 83 int model_index, | 84 int model_index, |
| 84 bool is_active) override; | 85 bool is_active) override; |
| 85 void TabDetachedAt(content::WebContents* contents, int model_index) override; | 86 void TabDetachedAt(content::WebContents* contents, int model_index) override; |
| 86 void TabSelectionChanged(TabStripModel* tab_strip_model, | 87 void TabSelectionChanged(TabStripModel* tab_strip_model, |
| 87 const ui::ListSelectionModel& old_model) override; | 88 const ui::ListSelectionModel& old_model) override; |
| 88 void TabMoved(content::WebContents* contents, | 89 void TabMoved(content::WebContents* contents, |
| 89 int from_model_index, | 90 int from_model_index, |
| 90 int to_model_index) override; | 91 int to_model_index) override; |
| 91 void TabChangedAt(content::WebContents* contents, | 92 void TabChangedAt(content::WebContents* contents, |
| 92 int model_index, | 93 int model_index, |
| 93 TabChangeType change_type) override; | 94 TabChangeType change_type) override; |
| 94 void TabReplacedAt(TabStripModel* tab_strip_model, | 95 void TabReplacedAt(TabStripModel* tab_strip_model, |
| 95 content::WebContents* old_contents, | 96 content::WebContents* old_contents, |
| 96 content::WebContents* new_contents, | 97 content::WebContents* new_contents, |
| 97 int model_index) override; | 98 int model_index) override; |
| 98 void TabPinnedStateChanged(TabStripModel* tab_strip_model, | 99 void TabPinnedStateChanged(TabStripModel* tab_strip_model, |
| 99 content::WebContents* contents, | 100 content::WebContents* contents, |
| 100 int model_index) override; | 101 int model_index) override; |
| 101 void TabBlockedStateChanged(content::WebContents* contents, | 102 void TabBlockedStateChanged(content::WebContents* contents, |
| 102 int model_index) override; | 103 int model_index) override; |
| 103 | 104 |
| 105 const Browser* browser() const { return browser_; } |
| 106 |
| 104 protected: | 107 protected: |
| 105 // The context in which SetTabRendererDataFromModel is being called. | 108 // The context in which SetTabRendererDataFromModel is being called. |
| 106 enum TabStatus { | 109 enum TabStatus { |
| 107 NEW_TAB, | 110 NEW_TAB, |
| 108 EXISTING_TAB | 111 EXISTING_TAB |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 // Sets the TabRendererData from the TabStripModel. | 114 // Sets the TabRendererData from the TabStripModel. |
| 112 virtual void SetTabRendererDataFromModel(content::WebContents* contents, | 115 virtual void SetTabRendererDataFromModel(content::WebContents* contents, |
| 113 int model_index, | 116 int model_index, |
| 114 TabRendererData* data, | 117 TabRendererData* data, |
| 115 TabStatus tab_status); | 118 TabStatus tab_status); |
| 116 | 119 |
| 117 Profile* profile() const { return model_->profile(); } | 120 Profile* profile() const { return model_->profile(); } |
| 118 | 121 |
| 119 const TabStrip* tabstrip() const { return tabstrip_; } | 122 const TabStrip* tabstrip() const { return tabstrip_; } |
| 120 | 123 |
| 121 const Browser* browser() const { return browser_; } | |
| 122 | |
| 123 private: | 124 private: |
| 124 class TabContextMenuContents; | 125 class TabContextMenuContents; |
| 125 | 126 |
| 126 // Invokes tabstrip_->SetTabData. | 127 // Invokes tabstrip_->SetTabData. |
| 127 void SetTabDataAt(content::WebContents* web_contents, int model_index); | 128 void SetTabDataAt(content::WebContents* web_contents, int model_index); |
| 128 | 129 |
| 129 void StartHighlightTabsForCommand( | 130 void StartHighlightTabsForCommand( |
| 130 TabStripModel::ContextMenuCommand command_id, | 131 TabStripModel::ContextMenuCommand command_id, |
| 131 Tab* tab); | 132 Tab* tab); |
| 132 void StopHighlightTabsForCommand( | 133 void StopHighlightTabsForCommand( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 163 std::unique_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; | 164 std::unique_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; |
| 164 | 165 |
| 165 PrefChangeRegistrar local_pref_registrar_; | 166 PrefChangeRegistrar local_pref_registrar_; |
| 166 | 167 |
| 167 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; | 168 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; |
| 168 | 169 |
| 169 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); | 170 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); |
| 170 }; | 171 }; |
| 171 | 172 |
| 172 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 173 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
| OLD | NEW |