| 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_VIEWS_TABS_SIDE_TAB_STRIP_MODEL_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_MODEL_H_ |
| 6 #define CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_MODEL_H_ | 6 #define CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 | 9 |
| 10 namespace gfx { |
| 11 class Point; |
| 12 } |
| 10 class SkBitmap; | 13 class SkBitmap; |
| 11 | 14 |
| 12 // A model interface implemented by an object that can provide information | 15 // A model interface implemented by an object that can provide information |
| 13 // about SideTabs in a SideTabStrip. | 16 // about SideTabs in a SideTabStrip. |
| 14 class SideTabStripModel { | 17 class SideTabStripModel { |
| 15 public: | 18 public: |
| 19 virtual ~SideTabStripModel() {} |
| 20 |
| 16 // Returns metadata about the tab at the specified index. | 21 // Returns metadata about the tab at the specified index. |
| 17 virtual SkBitmap GetIcon(int index) const = 0; | 22 virtual SkBitmap GetIcon(int index) const = 0; |
| 18 virtual string16 GetTitle(int index) const = 0; | 23 virtual string16 GetTitle(int index) const = 0; |
| 19 virtual bool IsSelected(int index) const = 0; | 24 virtual bool IsSelected(int index) const = 0; |
| 20 | 25 |
| 21 // Different types of network activity for a tab. The NetworkState of a tab | 26 // Different types of network activity for a tab. The NetworkState of a tab |
| 22 // may be used to alter the UI (e.g. show different kinds of loading | 27 // may be used to alter the UI (e.g. show different kinds of loading |
| 23 // animations). | 28 // animations). |
| 24 enum NetworkState { | 29 enum NetworkState { |
| 25 NetworkState_None, // no network activity. | 30 NetworkState_None, // no network activity. |
| 26 NetworkState_Waiting, // waiting for a connection. | 31 NetworkState_Waiting, // waiting for a connection. |
| 27 NetworkState_Loading // connected, transferring data. | 32 NetworkState_Loading // connected, transferring data. |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 // Returns the NetworkState of the tab at the specified index. | 35 // Returns the NetworkState of the tab at the specified index. |
| 31 virtual NetworkState GetNetworkState(int index) const = 0; | 36 virtual NetworkState GetNetworkState(int index) const = 0; |
| 32 | 37 |
| 33 // Select the tab at the specified index in the model. | 38 // Select the tab at the specified index in the model. |
| 34 virtual void SelectTab(int index) = 0; | 39 virtual void SelectTab(int index) = 0; |
| 35 | 40 |
| 36 // Closes the tab at the specified index in the model. | 41 // Closes the tab at the specified index in the model. |
| 37 virtual void CloseTab(int index) = 0; | 42 virtual void CloseTab(int index) = 0; |
| 43 |
| 44 // Shows a context menu for the tab at the specified index at the specified |
| 45 // point in screen coords. |
| 46 virtual void ShowContextMenu(int index, const gfx::Point& p) = 0; |
| 38 }; | 47 }; |
| 39 | 48 |
| 40 #endif // CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_MODEL_H_ | 49 #endif // CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_MODEL_H_ |
| 41 | 50 |
| OLD | NEW |