OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TOUCH_TABS_TOUCH_TAB_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ |
6 #define CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ | 6 #define CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" | 9 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" |
10 | 10 |
| 11 class TabStripSelectionModel; |
11 class TouchTab; | 12 class TouchTab; |
12 | 13 |
13 /////////////////////////////////////////////////////////////////////////////// | 14 /////////////////////////////////////////////////////////////////////////////// |
14 // | 15 // |
15 // TouchTabStrip | 16 // TouchTabStrip |
16 // | 17 // |
17 // A View that represents the TabStripModel. The TouchTabStrip has the | 18 // A View that represents the TabStripModel. The TouchTabStrip has the |
18 // following responsibilities: | 19 // following responsibilities: |
19 // - It implements the TabStripModelObserver interface, and acts as a | 20 // - It implements the TabStripModelObserver interface, and acts as a |
20 // container for Tabs, and is also responsible for creating them. | 21 // container for Tabs, and is also responsible for creating them. |
21 // | 22 // |
22 // TODO(wyck): Use transformable views for scrolling. | 23 // TODO(wyck): Use transformable views for scrolling. |
23 /////////////////////////////////////////////////////////////////////////////// | 24 /////////////////////////////////////////////////////////////////////////////// |
24 class TouchTabStrip : public BaseTabStrip { | 25 class TouchTabStrip : public BaseTabStrip { |
25 public: | 26 public: |
26 explicit TouchTabStrip(TabStripController* controller); | 27 explicit TouchTabStrip(TabStripController* controller); |
27 virtual ~TouchTabStrip(); | 28 virtual ~TouchTabStrip(); |
28 | 29 |
29 // AbstractTabStripView implementation: | 30 // AbstractTabStripView implementation: |
30 virtual bool IsPositionInWindowCaption(const gfx::Point& point); | 31 virtual bool IsPositionInWindowCaption(const gfx::Point& point); |
31 virtual void SetBackgroundOffset(const gfx::Point& offset); | 32 virtual void SetBackgroundOffset(const gfx::Point& offset); |
32 | 33 |
33 // BaseTabStrip implementation: | 34 // BaseTabStrip implementation: |
34 virtual void PrepareForCloseAt(int model_index); | 35 virtual void PrepareForCloseAt(int model_index); |
35 virtual void StartHighlight(int model_index); | 36 virtual void StartHighlight(int model_index); |
36 virtual void StopAllHighlighting(); | 37 virtual void StopAllHighlighting(); |
37 virtual BaseTab* CreateTabForDragging(); | 38 virtual BaseTab* CreateTabForDragging(); |
38 virtual void RemoveTabAt(int model_index); | 39 virtual void RemoveTabAt(int model_index); |
39 virtual void SelectTabAt(int old_model_index, int new_model_index); | 40 virtual void SetSelection(const TabStripSelectionModel& old_selection, |
| 41 const TabStripSelectionModel& new_selection); |
40 virtual void TabTitleChangedNotLoading(int model_index); | 42 virtual void TabTitleChangedNotLoading(int model_index); |
41 virtual BaseTab* CreateTab(); | 43 virtual BaseTab* CreateTab(); |
42 virtual void StartInsertTabAnimation(int model_index); | 44 virtual void StartInsertTabAnimation(int model_index); |
43 virtual void AnimateToIdealBounds(); | 45 virtual void AnimateToIdealBounds(); |
44 virtual bool ShouldHighlightCloseButtonAfterRemove(); | 46 virtual bool ShouldHighlightCloseButtonAfterRemove(); |
45 virtual void GenerateIdealBounds(); | 47 virtual void GenerateIdealBounds(); |
46 virtual void LayoutDraggedTabsAt(const std::vector<BaseTab*>& tabs, | 48 virtual void LayoutDraggedTabsAt(const std::vector<BaseTab*>& tabs, |
47 BaseTab* active_tab, | 49 BaseTab* active_tab, |
48 const gfx::Point& location, | 50 const gfx::Point& location, |
49 bool initial_drag); | 51 bool initial_drag); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 TouchTab* initial_tab_; | 128 TouchTab* initial_tab_; |
127 | 129 |
128 // The minimum value that |scroll_offset_| can have. Based on the total | 130 // The minimum value that |scroll_offset_| can have. Based on the total |
129 // width of all the content to be scrolled, less the viewport size. | 131 // width of all the content to be scrolled, less the viewport size. |
130 int min_scroll_offset_; | 132 int min_scroll_offset_; |
131 | 133 |
132 DISALLOW_COPY_AND_ASSIGN(TouchTabStrip); | 134 DISALLOW_COPY_AND_ASSIGN(TouchTabStrip); |
133 }; | 135 }; |
134 | 136 |
135 #endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ | 137 #endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ |
OLD | NEW |