 Chromium Code Reviews
 Chromium Code Reviews| Index: chrome/browser/ui/touch/tabs/touch_tab_strip.h | 
| diff --git a/chrome/browser/ui/touch/tabs/touch_tab_strip.h b/chrome/browser/ui/touch/tabs/touch_tab_strip.h | 
| index 1ba8b400d714fbd6c572db608c284a3797c6d418..9d6891f4435de1517dd3cedb8ca98a15638cf24a 100644 | 
| --- a/chrome/browser/ui/touch/tabs/touch_tab_strip.h | 
| +++ b/chrome/browser/ui/touch/tabs/touch_tab_strip.h | 
| @@ -48,6 +48,12 @@ class TouchTabStrip : public BaseTabStrip { | 
| bool initial_drag); | 
| virtual int GetSizeNeededForTabs(const std::vector<BaseTab*>& tabs); | 
| + // views::View overrides: | 
| + virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 
| + virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 
| + virtual void OnMouseReleased(const views::MouseEvent& event, | 
| + bool canceled) OVERRIDE; | 
| + | 
| // Retrieves the Tab at the specified index. Remember, the specified index | 
| // is in terms of tab_data, *not* the model. | 
| TouchTab* GetTabAtTabDataIndex(int tab_data_index) const; | 
| @@ -64,6 +70,24 @@ class TouchTabStrip : public BaseTabStrip { | 
| View* parent, | 
| View* child) OVERRIDE; | 
| + // Adjusts the state of scroll interaction when a mouse press occurs at the | 
| + // given point. Sets an appropriate |initial_scroll_offset_|. | 
| + void BeginScroll(const gfx::Point& point); | 
| 
rjkroege
2011/03/28 22:07:40
not to make your life difficult... maybe there cou
 
wyck
2011/03/30 15:53:11
I'm assuming you're talking about the gestures for
 | 
| + | 
| + // Adjusts the state of scroll interaction when the mouse is dragged to the | 
| + // given point. If the scroll is not beyond the minimum threshold, the tabs | 
| + // will not actually scroll. | 
| + void ContinueScroll(const gfx::Point& point); | 
| + | 
| + // Adjusts the state of scroll interaction when the mouse is released. Either | 
| + // scrolls to the final mouse release point or selects the current tab | 
| + // depending on whether the mouse was dragged beyone the minimum threshold. | 
| + void EndScroll(const gfx::Point& point); | 
| + | 
| + // Adjust the positions of the tabs to perform a scroll of |delta_x| relative | 
| + // to the |initial_scroll_offset_|. | 
| + void ScrollTo(int delta_x); | 
| + | 
| // True if PrepareForCloseAt has been invoked. When true remove animations | 
| // preserve current tab bounds. | 
| bool in_tab_close_; | 
| @@ -74,6 +98,29 @@ class TouchTabStrip : public BaseTabStrip { | 
| // The view that was tapped last. | 
| View* last_tapped_view_; | 
| + // Records the mouse x coordinate at the start of a drag operation. | 
| + int initial_mouse_x_; | 
| + | 
| + // Records the scroll offset at the time of the start of a drag operation. | 
| + int initial_scroll_offset_; | 
| 
rjkroege
2011/03/28 22:07:40
we should be moving towards floats... all these th
 
wyck
2011/03/30 15:53:11
Noted, but will input devices operate in the float
 | 
| + | 
| + // The current offset of the view. Positive scroll offsets move the icons to | 
| + // the left. Negative scroll offsets move the icons to the right. | 
| + int scroll_offset_; | 
| + | 
| + // State of the scrolling interaction. Will be true once the drag has been | 
| + // displaced beyond the minimum dragging threshold. | 
| + bool scrolling_; | 
| + | 
| + // Records the tab that was under the initial mouse press. Must match the | 
| + // tab that was under the final mouse release in order for the tab to | 
| + // be selected. | 
| + TouchTab* initial_tab_; | 
| + | 
| + // The minimum value that |scroll_offset_| can have. Based on the total | 
| + // width of all the content to be scrolled, less the viewport size. | 
| + int min_scroll_offset_; | 
| + | 
| DISALLOW_COPY_AND_ASSIGN(TouchTabStrip); | 
| }; |