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