| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 const ui::MouseEvent& event) override; | 234 const ui::MouseEvent& event) override; |
| 235 bool ShouldPaintTab( | 235 bool ShouldPaintTab( |
| 236 const Tab* tab, | 236 const Tab* tab, |
| 237 const base::Callback<gfx::Path(const gfx::Size&)>& border_callback, | 237 const base::Callback<gfx::Path(const gfx::Size&)>& border_callback, |
| 238 gfx::Path* clip) override; | 238 gfx::Path* clip) override; |
| 239 bool CanPaintThrobberToLayer() const override; | 239 bool CanPaintThrobberToLayer() const override; |
| 240 bool IsImmersiveStyle() const override; | 240 bool IsImmersiveStyle() const override; |
| 241 SkColor GetToolbarTopSeparatorColor() const override; | 241 SkColor GetToolbarTopSeparatorColor() const override; |
| 242 int GetBackgroundResourceId(bool* custom_image) const override; | 242 int GetBackgroundResourceId(bool* custom_image) const override; |
| 243 void UpdateTabAccessibilityState(const Tab* tab, | 243 void UpdateTabAccessibilityState(const Tab* tab, |
| 244 ui::AXViewState* state) override; | 244 ui::AXNodeData* node_data) override; |
| 245 | 245 |
| 246 // MouseWatcherListener overrides: | 246 // MouseWatcherListener overrides: |
| 247 void MouseMovedOutOfHost() override; | 247 void MouseMovedOutOfHost() override; |
| 248 | 248 |
| 249 // views::View overrides: | 249 // views::View overrides: |
| 250 void Layout() override; | 250 void Layout() override; |
| 251 void PaintChildren(const ui::PaintContext& context) override; | 251 void PaintChildren(const ui::PaintContext& context) override; |
| 252 const char* GetClassName() const override; | 252 const char* GetClassName() const override; |
| 253 gfx::Size GetPreferredSize() const override; | 253 gfx::Size GetPreferredSize() const override; |
| 254 // NOTE: the drag and drop methods are invoked from FrameView. This is done | 254 // NOTE: the drag and drop methods are invoked from FrameView. This is done |
| 255 // to allow for a drop region that extends outside the bounds of the TabStrip. | 255 // to allow for a drop region that extends outside the bounds of the TabStrip. |
| 256 void OnDragEntered(const ui::DropTargetEvent& event) override; | 256 void OnDragEntered(const ui::DropTargetEvent& event) override; |
| 257 int OnDragUpdated(const ui::DropTargetEvent& event) override; | 257 int OnDragUpdated(const ui::DropTargetEvent& event) override; |
| 258 void OnDragExited() override; | 258 void OnDragExited() override; |
| 259 int OnPerformDrop(const ui::DropTargetEvent& event) override; | 259 int OnPerformDrop(const ui::DropTargetEvent& event) override; |
| 260 void GetAccessibleState(ui::AXViewState* state) override; | 260 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 261 views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; | 261 views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; |
| 262 | 262 |
| 263 // Returns preferred height in immersive style. | 263 // Returns preferred height in immersive style. |
| 264 static int GetImmersiveHeight(); | 264 static int GetImmersiveHeight(); |
| 265 | 265 |
| 266 private: | 266 private: |
| 267 typedef std::vector<Tab*> Tabs; | 267 typedef std::vector<Tab*> Tabs; |
| 268 typedef std::map<int, Tabs> TabsClosingMap; | 268 typedef std::map<int, Tabs> TabsClosingMap; |
| 269 typedef std::pair<TabsClosingMap::iterator, | 269 typedef std::pair<TabsClosingMap::iterator, |
| 270 Tabs::iterator> FindClosingTabResult; | 270 Tabs::iterator> FindClosingTabResult; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 std::vector<gfx::Rect>* bounds); | 372 std::vector<gfx::Rect>* bounds); |
| 373 | 373 |
| 374 // Returns the size needed for the specified tabs. This is invoked during drag | 374 // Returns the size needed for the specified tabs. This is invoked during drag |
| 375 // and drop to calculate offsets and positioning. | 375 // and drop to calculate offsets and positioning. |
| 376 int GetSizeNeededForTabs(const Tabs& tabs); | 376 int GetSizeNeededForTabs(const Tabs& tabs); |
| 377 | 377 |
| 378 // Returns the number of pinned tabs. | 378 // Returns the number of pinned tabs. |
| 379 int GetPinnedTabCount() const; | 379 int GetPinnedTabCount() const; |
| 380 | 380 |
| 381 // Returns the last tab in the strip that's actually visible. This will be | 381 // Returns the last tab in the strip that's actually visible. This will be |
| 382 // the actual last tab unless the strip is in the overflow state. | 382 // the actual last tab unless the strip is in the overflow node_data. |
| 383 const Tab* GetLastVisibleTab() const; | 383 const Tab* GetLastVisibleTab() const; |
| 384 | 384 |
| 385 // Adds the tab at |index| to |tabs_closing_map_| and removes the tab from | 385 // Adds the tab at |index| to |tabs_closing_map_| and removes the tab from |
| 386 // |tabs_|. | 386 // |tabs_|. |
| 387 void RemoveTabFromViewModel(int index); | 387 void RemoveTabFromViewModel(int index); |
| 388 | 388 |
| 389 // Cleans up the Tab from the TabStrip. This is called from the tab animation | 389 // Cleans up the Tab from the TabStrip. This is called from the tab animation |
| 390 // code and is not a general-purpose method. | 390 // code and is not a general-purpose method. |
| 391 void RemoveAndDeleteTab(Tab* tab); | 391 void RemoveAndDeleteTab(Tab* tab); |
| 392 | 392 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 bool immersive_style_; | 653 bool immersive_style_; |
| 654 | 654 |
| 655 // Our observers. | 655 // Our observers. |
| 656 typedef base::ObserverList<TabStripObserver> TabStripObservers; | 656 typedef base::ObserverList<TabStripObserver> TabStripObservers; |
| 657 TabStripObservers observers_; | 657 TabStripObservers observers_; |
| 658 | 658 |
| 659 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 659 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 660 }; | 660 }; |
| 661 | 661 |
| 662 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 662 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |