| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_TABS_TAB_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 bool IsTabStripCloseable() const; | 154 bool IsTabStripCloseable() const; |
| 155 | 155 |
| 156 // Updates the loading animations displayed by tabs in the tabstrip to the | 156 // Updates the loading animations displayed by tabs in the tabstrip to the |
| 157 // next frame. | 157 // next frame. |
| 158 void UpdateLoadingAnimations(); | 158 void UpdateLoadingAnimations(); |
| 159 | 159 |
| 160 // Returns true if the specified point (in TabStrip coordinates) is in the | 160 // Returns true if the specified point (in TabStrip coordinates) is in the |
| 161 // window caption area of the browser window. | 161 // window caption area of the browser window. |
| 162 bool IsPositionInWindowCaption(const gfx::Point& point); | 162 bool IsPositionInWindowCaption(const gfx::Point& point); |
| 163 | 163 |
| 164 // Returns true if the specified rect (in TabStrip coordinates) intersects |
| 165 // the window caption area of the browser window. |
| 166 bool IsRectInWindowCaption(const gfx::Rect& rect); |
| 167 |
| 164 // Set the background offset used by inactive tabs to match the frame image. | 168 // Set the background offset used by inactive tabs to match the frame image. |
| 165 void SetBackgroundOffset(const gfx::Point& offset); | 169 void SetBackgroundOffset(const gfx::Point& offset); |
| 166 | 170 |
| 167 // Returns the new tab button. This is never NULL. | 171 // Returns the new tab button. This is never NULL. |
| 168 views::View* newtab_button(); | 172 views::View* newtab_button(); |
| 169 | 173 |
| 170 // Sets a painting style with miniature "tab indicator" rectangles at the top. | 174 // Sets a painting style with miniature "tab indicator" rectangles at the top. |
| 171 void SetImmersiveStyle(bool enable); | 175 void SetImmersiveStyle(bool enable); |
| 172 | 176 |
| 173 // Returns true if Tabs in this TabStrip are currently changing size or | 177 // Returns true if Tabs in this TabStrip are currently changing size or |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 218 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| 215 virtual const char* GetClassName() const OVERRIDE; | 219 virtual const char* GetClassName() const OVERRIDE; |
| 216 virtual gfx::Size GetPreferredSize() OVERRIDE; | 220 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 217 // NOTE: the drag and drop methods are invoked from FrameView. This is done | 221 // NOTE: the drag and drop methods are invoked from FrameView. This is done |
| 218 // to allow for a drop region that extends outside the bounds of the TabStrip. | 222 // to allow for a drop region that extends outside the bounds of the TabStrip. |
| 219 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; | 223 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
| 220 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 224 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
| 221 virtual void OnDragExited() OVERRIDE; | 225 virtual void OnDragExited() OVERRIDE; |
| 222 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 226 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
| 223 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 227 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 224 virtual views::View* GetEventHandlerForPoint( | 228 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; |
| 225 const gfx::Point& point) OVERRIDE; | |
| 226 virtual views::View* GetTooltipHandlerForPoint( | 229 virtual views::View* GetTooltipHandlerForPoint( |
| 227 const gfx::Point& point) OVERRIDE; | 230 const gfx::Point& point) OVERRIDE; |
| 228 | 231 |
| 229 // Returns preferred height in immersive style. | 232 // Returns preferred height in immersive style. |
| 230 static int GetImmersiveHeight(); | 233 static int GetImmersiveHeight(); |
| 231 | 234 |
| 232 protected: | 235 protected: |
| 233 // Horizontal gap between mini and non-mini-tabs. | 236 // Horizontal gap between mini and non-mini-tabs. |
| 234 static const int kMiniToNonMiniGap; | 237 static const int kMiniToNonMiniGap; |
| 235 | 238 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 490 |
| 488 // Starts various types of TabStrip animations. | 491 // Starts various types of TabStrip animations. |
| 489 void StartResizeLayoutAnimation(); | 492 void StartResizeLayoutAnimation(); |
| 490 void StartMiniTabAnimation(); | 493 void StartMiniTabAnimation(); |
| 491 void StartMouseInitiatedRemoveTabAnimation(int model_index); | 494 void StartMouseInitiatedRemoveTabAnimation(int model_index); |
| 492 | 495 |
| 493 // Returns true if the specified point in TabStrip coords is within the | 496 // Returns true if the specified point in TabStrip coords is within the |
| 494 // hit-test region of the specified Tab. | 497 // hit-test region of the specified Tab. |
| 495 bool IsPointInTab(Tab* tab, const gfx::Point& point_in_tabstrip_coords); | 498 bool IsPointInTab(Tab* tab, const gfx::Point& point_in_tabstrip_coords); |
| 496 | 499 |
| 500 // Returns true if the specified rect in TabStrip coords intersects the |
| 501 // hit-test region of the specified Tab. |
| 502 bool IsRectInTab(Tab* tab, const gfx::Rect& rect_in_tabstrip_coords); |
| 503 |
| 497 // -- Touch Layout ---------------------------------------------------------- | 504 // -- Touch Layout ---------------------------------------------------------- |
| 498 | 505 |
| 499 // Returns the position normal tabs start at. | 506 // Returns the position normal tabs start at. |
| 500 int GetStartXForNormalTabs() const; | 507 int GetStartXForNormalTabs() const; |
| 501 | 508 |
| 502 // Returns the tab to use for event handling. This uses FindTabForEventFrom() | 509 // Returns the tab to use for event handling. This uses FindTabForEventFrom() |
| 503 // to do the actual searching. | 510 // to do the actual searching. |
| 504 Tab* FindTabForEvent(const gfx::Point& point); | 511 Tab* FindTabForEvent(const gfx::Point& point); |
| 505 | 512 |
| 506 // Returns the tab to use for event handling starting at index |start| and | 513 // Returns the tab to use for event handling starting at index |start| and |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 bool immersive_style_; | 629 bool immersive_style_; |
| 623 | 630 |
| 624 // Our observers. | 631 // Our observers. |
| 625 typedef ObserverList<TabStripObserver> TabStripObservers; | 632 typedef ObserverList<TabStripObserver> TabStripObservers; |
| 626 TabStripObservers observers_; | 633 TabStripObservers observers_; |
| 627 | 634 |
| 628 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 635 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 629 }; | 636 }; |
| 630 | 637 |
| 631 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 638 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |