| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TABS_TAB_STRIP_MODEL_H_ | 5 #ifndef CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 virtual void BookmarkAllTabs() = 0; | 229 virtual void BookmarkAllTabs() = 0; |
| 230 | 230 |
| 231 // Returns true if any of the tabs can be closed. | 231 // Returns true if any of the tabs can be closed. |
| 232 virtual bool CanCloseTab() const; | 232 virtual bool CanCloseTab() const; |
| 233 | 233 |
| 234 // Returns true if the vertical tabstrip presentation should be used. | 234 // Returns true if the vertical tabstrip presentation should be used. |
| 235 virtual bool UseVerticalTabs() const = 0; | 235 virtual bool UseVerticalTabs() const = 0; |
| 236 | 236 |
| 237 // Toggles the use of the vertical tabstrip. | 237 // Toggles the use of the vertical tabstrip. |
| 238 virtual void ToggleUseVerticalTabs() = 0; | 238 virtual void ToggleUseVerticalTabs() = 0; |
| 239 | |
| 240 // Set the visiblity of the toolbar. | |
| 241 virtual void SetToolbarVisibility(bool value) = 0; | |
| 242 }; | 239 }; |
| 243 | 240 |
| 244 //////////////////////////////////////////////////////////////////////////////// | 241 //////////////////////////////////////////////////////////////////////////////// |
| 245 // | 242 // |
| 246 // TabStripModel | 243 // TabStripModel |
| 247 // | 244 // |
| 248 // A model & low level controller of a Browser Window tabstrip. Holds a vector | 245 // A model & low level controller of a Browser Window tabstrip. Holds a vector |
| 249 // of TabContents, and provides an API for adding, removing and shuffling | 246 // of TabContents, and provides an API for adding, removing and shuffling |
| 250 // them, as well as a higher level API for doing specific Browser-related | 247 // them, as well as a higher level API for doing specific Browser-related |
| 251 // tasks like adding new Tabs from just a URL, etc. | 248 // tasks like adding new Tabs from just a URL, etc. |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 bool IsTabPinned(int index) const; | 541 bool IsTabPinned(int index) const; |
| 545 | 542 |
| 546 // Is the tab a mini-tab? | 543 // Is the tab a mini-tab? |
| 547 // See description above class for details on this. | 544 // See description above class for details on this. |
| 548 bool IsMiniTab(int index) const; | 545 bool IsMiniTab(int index) const; |
| 549 | 546 |
| 550 // Is the tab at |index| an app? | 547 // Is the tab at |index| an app? |
| 551 // See description above class for details on app tabs. | 548 // See description above class for details on app tabs. |
| 552 bool IsAppTab(int index) const; | 549 bool IsAppTab(int index) const; |
| 553 | 550 |
| 554 // Returns true if the toolbar is visible for the tab at |index|. | |
| 555 bool IsToolbarVisible(int index) const; | |
| 556 | |
| 557 // Returns true if the tab is a phantom tab. A phantom tab is one where the | 551 // Returns true if the tab is a phantom tab. A phantom tab is one where the |
| 558 // renderer has not been loaded. | 552 // renderer has not been loaded. |
| 559 // See description above class for details on phantom tabs. | 553 // See description above class for details on phantom tabs. |
| 560 bool IsPhantomTab(int index) const; | 554 bool IsPhantomTab(int index) const; |
| 561 | 555 |
| 562 // Returns true if the tab at |index| is blocked by a tab modal dialog. | 556 // Returns true if the tab at |index| is blocked by a tab modal dialog. |
| 563 bool IsTabBlocked(int index) const; | 557 bool IsTabBlocked(int index) const; |
| 564 | 558 |
| 565 // Returns the index of the first tab that is not a mini-tab. This returns | 559 // Returns the index of the first tab that is not a mini-tab. This returns |
| 566 // |count()| if all of the tabs are mini-tabs, and 0 if none of the tabs are | 560 // |count()| if all of the tabs are mini-tabs, and 0 if none of the tabs are |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 enum ContextMenuCommand { | 613 enum ContextMenuCommand { |
| 620 CommandFirst = 0, | 614 CommandFirst = 0, |
| 621 CommandNewTab, | 615 CommandNewTab, |
| 622 CommandReload, | 616 CommandReload, |
| 623 CommandDuplicate, | 617 CommandDuplicate, |
| 624 CommandCloseTab, | 618 CommandCloseTab, |
| 625 CommandCloseOtherTabs, | 619 CommandCloseOtherTabs, |
| 626 CommandCloseTabsToRight, | 620 CommandCloseTabsToRight, |
| 627 CommandRestoreTab, | 621 CommandRestoreTab, |
| 628 CommandTogglePinned, | 622 CommandTogglePinned, |
| 629 CommandToggleToolbar, | |
| 630 CommandBookmarkAllTabs, | 623 CommandBookmarkAllTabs, |
| 631 CommandUseVerticalTabs, | 624 CommandUseVerticalTabs, |
| 632 CommandLast | 625 CommandLast |
| 633 }; | 626 }; |
| 634 | 627 |
| 635 // Returns true if the specified command is enabled. | 628 // Returns true if the specified command is enabled. |
| 636 bool IsContextMenuCommandEnabled(int context_index, | 629 bool IsContextMenuCommandEnabled(int context_index, |
| 637 ContextMenuCommand command_id) const; | 630 ContextMenuCommand command_id) const; |
| 638 | 631 |
| 639 // Returns true if the specified command is checked. | 632 // Returns true if the specified command is checked. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 typedef ObserverList<TabStripModelObserver> TabStripModelObservers; | 805 typedef ObserverList<TabStripModelObserver> TabStripModelObservers; |
| 813 TabStripModelObservers observers_; | 806 TabStripModelObservers observers_; |
| 814 | 807 |
| 815 // A scoped container for notification registries. | 808 // A scoped container for notification registries. |
| 816 NotificationRegistrar registrar_; | 809 NotificationRegistrar registrar_; |
| 817 | 810 |
| 818 DISALLOW_COPY_AND_ASSIGN(TabStripModel); | 811 DISALLOW_COPY_AND_ASSIGN(TabStripModel); |
| 819 }; | 812 }; |
| 820 | 813 |
| 821 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 814 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| OLD | NEW |