Chromium Code Reviews| 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 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 virtual void StartInsertTabAnimation(int model_index); | 41 virtual void StartInsertTabAnimation(int model_index); |
| 42 virtual void AnimateToIdealBounds(); | 42 virtual void AnimateToIdealBounds(); |
| 43 virtual bool ShouldHighlightCloseButtonAfterRemove(); | 43 virtual bool ShouldHighlightCloseButtonAfterRemove(); |
| 44 virtual void GenerateIdealBounds(); | 44 virtual void GenerateIdealBounds(); |
| 45 virtual void LayoutDraggedTabsAt(const std::vector<BaseTab*>& tabs, | 45 virtual void LayoutDraggedTabsAt(const std::vector<BaseTab*>& tabs, |
| 46 BaseTab* active_tab, | 46 BaseTab* active_tab, |
| 47 const gfx::Point& location, | 47 const gfx::Point& location, |
| 48 bool initial_drag); | 48 bool initial_drag); |
| 49 virtual int GetSizeNeededForTabs(const std::vector<BaseTab*>& tabs); | 49 virtual int GetSizeNeededForTabs(const std::vector<BaseTab*>& tabs); |
| 50 | 50 |
| 51 // views::View overrides: | |
| 52 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | |
| 53 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | |
| 54 virtual void OnMouseReleased(const views::MouseEvent& event, | |
| 55 bool canceled) OVERRIDE; | |
| 56 | |
| 51 // Retrieves the Tab at the specified index. Remember, the specified index | 57 // Retrieves the Tab at the specified index. Remember, the specified index |
| 52 // is in terms of tab_data, *not* the model. | 58 // is in terms of tab_data, *not* the model. |
| 53 TouchTab* GetTabAtTabDataIndex(int tab_data_index) const; | 59 TouchTab* GetTabAtTabDataIndex(int tab_data_index) const; |
| 54 | 60 |
| 55 private: | 61 private: |
| 56 void Init(); | 62 void Init(); |
| 57 | 63 |
| 58 // Overridden from views::View. | 64 // Overridden from views::View. |
| 59 virtual gfx::Size GetPreferredSize() OVERRIDE; | 65 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 60 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 66 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| 61 virtual views::View::TouchStatus OnTouchEvent( | 67 virtual views::View::TouchStatus OnTouchEvent( |
| 62 const views::TouchEvent& event) OVERRIDE; | 68 const views::TouchEvent& event) OVERRIDE; |
| 63 virtual void ViewHierarchyChanged(bool is_add, | 69 virtual void ViewHierarchyChanged(bool is_add, |
| 64 View* parent, | 70 View* parent, |
| 65 View* child) OVERRIDE; | 71 View* child) OVERRIDE; |
| 72 TouchTab* GetTabAtLocal(const gfx::Point& local_point); | |
|
sky
2011/03/25 21:05:25
Newline between 71 and 72 to make it clear this is
wyck
2011/03/28 14:21:43
Done.
| |
| 73 void BeginScroll(const gfx::Point& point); | |
| 74 void ContinueScroll(const gfx::Point& point); | |
| 75 void EndScroll(const gfx::Point& point); | |
| 76 void ScrollTo(int delta_x); | |
| 66 | 77 |
| 67 // True if PrepareForCloseAt has been invoked. When true remove animations | 78 // True if PrepareForCloseAt has been invoked. When true remove animations |
| 68 // preserve current tab bounds. | 79 // preserve current tab bounds. |
| 69 bool in_tab_close_; | 80 bool in_tab_close_; |
| 70 | 81 |
| 71 // Last time the tabstrip was tapped. | 82 // Last time the tabstrip was tapped. |
| 72 base::Time last_tap_time_; | 83 base::Time last_tap_time_; |
| 73 | 84 |
| 74 // The view that was tapped last. | 85 // The view that was tapped last. |
| 75 View* last_tapped_view_; | 86 View* last_tapped_view_; |
| 76 | 87 |
| 88 int initial_mouse_x_; | |
| 89 int initial_scroll_offset_; | |
| 90 int scroll_offset_; | |
| 91 bool scrolling_; | |
| 92 TouchTab* initial_tab_; | |
| 93 int min_scroll_offset_; | |
| 94 | |
| 77 DISALLOW_COPY_AND_ASSIGN(TouchTabStrip); | 95 DISALLOW_COPY_AND_ASSIGN(TouchTabStrip); |
| 78 }; | 96 }; |
| 79 | 97 |
| 80 #endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ | 98 #endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_H_ |
| OLD | NEW |