| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 bool IsAnimating() const; | 204 bool IsAnimating() const; |
| 205 | 205 |
| 206 // Stops any ongoing animations. If |layout| is true and an animation is | 206 // Stops any ongoing animations. If |layout| is true and an animation is |
| 207 // ongoing this does a layout. | 207 // ongoing this does a layout. |
| 208 void StopAnimating(bool layout); | 208 void StopAnimating(bool layout); |
| 209 | 209 |
| 210 // Called to indicate whether the given URL is a supported file. | 210 // Called to indicate whether the given URL is a supported file. |
| 211 void FileSupported(const GURL& url, bool supported); | 211 void FileSupported(const GURL& url, bool supported); |
| 212 | 212 |
| 213 // TabController overrides: | 213 // TabController overrides: |
| 214 virtual const ui::ListSelectionModel& GetSelectionModel() OVERRIDE; | 214 virtual const ui::ListSelectionModel& GetSelectionModel() override; |
| 215 virtual bool SupportsMultipleSelection() OVERRIDE; | 215 virtual bool SupportsMultipleSelection() override; |
| 216 virtual void SelectTab(Tab* tab) OVERRIDE; | 216 virtual void SelectTab(Tab* tab) override; |
| 217 virtual void ExtendSelectionTo(Tab* tab) OVERRIDE; | 217 virtual void ExtendSelectionTo(Tab* tab) override; |
| 218 virtual void ToggleSelected(Tab* tab) OVERRIDE; | 218 virtual void ToggleSelected(Tab* tab) override; |
| 219 virtual void AddSelectionFromAnchorTo(Tab* tab) OVERRIDE; | 219 virtual void AddSelectionFromAnchorTo(Tab* tab) override; |
| 220 virtual void CloseTab(Tab* tab, CloseTabSource source) OVERRIDE; | 220 virtual void CloseTab(Tab* tab, CloseTabSource source) override; |
| 221 virtual void ToggleTabAudioMute(Tab* tab) OVERRIDE; | 221 virtual void ToggleTabAudioMute(Tab* tab) override; |
| 222 virtual void ShowContextMenuForTab(Tab* tab, | 222 virtual void ShowContextMenuForTab(Tab* tab, |
| 223 const gfx::Point& p, | 223 const gfx::Point& p, |
| 224 ui::MenuSourceType source_type) OVERRIDE; | 224 ui::MenuSourceType source_type) override; |
| 225 virtual bool IsActiveTab(const Tab* tab) const OVERRIDE; | 225 virtual bool IsActiveTab(const Tab* tab) const override; |
| 226 virtual bool IsTabSelected(const Tab* tab) const OVERRIDE; | 226 virtual bool IsTabSelected(const Tab* tab) const override; |
| 227 virtual bool IsTabPinned(const Tab* tab) const OVERRIDE; | 227 virtual bool IsTabPinned(const Tab* tab) const override; |
| 228 virtual void MaybeStartDrag( | 228 virtual void MaybeStartDrag( |
| 229 Tab* tab, | 229 Tab* tab, |
| 230 const ui::LocatedEvent& event, | 230 const ui::LocatedEvent& event, |
| 231 const ui::ListSelectionModel& original_selection) OVERRIDE; | 231 const ui::ListSelectionModel& original_selection) override; |
| 232 virtual void ContinueDrag(views::View* view, | 232 virtual void ContinueDrag(views::View* view, |
| 233 const ui::LocatedEvent& event) OVERRIDE; | 233 const ui::LocatedEvent& event) override; |
| 234 virtual bool EndDrag(EndDragReason reason) OVERRIDE; | 234 virtual bool EndDrag(EndDragReason reason) override; |
| 235 virtual Tab* GetTabAt(Tab* tab, | 235 virtual Tab* GetTabAt(Tab* tab, |
| 236 const gfx::Point& tab_in_tab_coordinates) OVERRIDE; | 236 const gfx::Point& tab_in_tab_coordinates) override; |
| 237 virtual void OnMouseEventInTab(views::View* source, | 237 virtual void OnMouseEventInTab(views::View* source, |
| 238 const ui::MouseEvent& event) OVERRIDE; | 238 const ui::MouseEvent& event) override; |
| 239 virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) OVERRIDE; | 239 virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) override; |
| 240 virtual bool IsImmersiveStyle() const OVERRIDE; | 240 virtual bool IsImmersiveStyle() const override; |
| 241 virtual void UpdateTabAccessibilityState(const Tab* tab, | 241 virtual void UpdateTabAccessibilityState(const Tab* tab, |
| 242 ui::AXViewState* state) OVERRIDE; | 242 ui::AXViewState* state) override; |
| 243 | 243 |
| 244 // MouseWatcherListener overrides: | 244 // MouseWatcherListener overrides: |
| 245 virtual void MouseMovedOutOfHost() OVERRIDE; | 245 virtual void MouseMovedOutOfHost() override; |
| 246 | 246 |
| 247 // views::View overrides: | 247 // views::View overrides: |
| 248 virtual void Layout() OVERRIDE; | 248 virtual void Layout() override; |
| 249 virtual void PaintChildren(gfx::Canvas* canvas, | 249 virtual void PaintChildren(gfx::Canvas* canvas, |
| 250 const views::CullSet& cull_set) OVERRIDE; | 250 const views::CullSet& cull_set) override; |
| 251 virtual const char* GetClassName() const OVERRIDE; | 251 virtual const char* GetClassName() const override; |
| 252 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 252 virtual gfx::Size GetPreferredSize() const override; |
| 253 // NOTE: the drag and drop methods are invoked from FrameView. This is done | 253 // NOTE: the drag and drop methods are invoked from FrameView. This is done |
| 254 // to allow for a drop region that extends outside the bounds of the TabStrip. | 254 // to allow for a drop region that extends outside the bounds of the TabStrip. |
| 255 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; | 255 virtual void OnDragEntered(const ui::DropTargetEvent& event) override; |
| 256 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 256 virtual int OnDragUpdated(const ui::DropTargetEvent& event) override; |
| 257 virtual void OnDragExited() OVERRIDE; | 257 virtual void OnDragExited() override; |
| 258 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 258 virtual int OnPerformDrop(const ui::DropTargetEvent& event) override; |
| 259 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 259 virtual void GetAccessibleState(ui::AXViewState* state) override; |
| 260 virtual views::View* GetTooltipHandlerForPoint( | 260 virtual views::View* GetTooltipHandlerForPoint( |
| 261 const gfx::Point& point) OVERRIDE; | 261 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; |
| 271 | 271 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // Returns true if |touch_layout_| is needed. | 560 // Returns true if |touch_layout_| is needed. |
| 561 bool NeedsTouchLayout() const; | 561 bool NeedsTouchLayout() const; |
| 562 | 562 |
| 563 // Sets the value of |reset_to_shrink_on_exit_|. If true |mouse_watcher_| is | 563 // Sets the value of |reset_to_shrink_on_exit_|. If true |mouse_watcher_| is |
| 564 // used to track when the mouse truly exits the tabstrip and the stacked | 564 // used to track when the mouse truly exits the tabstrip and the stacked |
| 565 // layout is reset. | 565 // layout is reset. |
| 566 void SetResetToShrinkOnExit(bool value); | 566 void SetResetToShrinkOnExit(bool value); |
| 567 | 567 |
| 568 // views::ButtonListener implementation: | 568 // views::ButtonListener implementation: |
| 569 virtual void ButtonPressed(views::Button* sender, | 569 virtual void ButtonPressed(views::Button* sender, |
| 570 const ui::Event& event) OVERRIDE; | 570 const ui::Event& event) override; |
| 571 | 571 |
| 572 // View overrides. | 572 // View overrides. |
| 573 virtual const views::View* GetViewByID(int id) const OVERRIDE; | 573 virtual const views::View* GetViewByID(int id) const override; |
| 574 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 574 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
| 575 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 575 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; |
| 576 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 576 virtual void OnMouseReleased(const ui::MouseEvent& event) override; |
| 577 virtual void OnMouseCaptureLost() OVERRIDE; | 577 virtual void OnMouseCaptureLost() override; |
| 578 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 578 virtual void OnMouseMoved(const ui::MouseEvent& event) override; |
| 579 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 579 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
| 580 | 580 |
| 581 // ui::EventHandler overrides. | 581 // ui::EventHandler overrides. |
| 582 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 582 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
| 583 | 583 |
| 584 // views::ViewTargeterDelegate: | 584 // views::ViewTargeterDelegate: |
| 585 virtual views::View* TargetForRect(views::View* root, | 585 virtual views::View* TargetForRect(views::View* root, |
| 586 const gfx::Rect& rect) OVERRIDE; | 586 const gfx::Rect& rect) override; |
| 587 | 587 |
| 588 // -- Member Variables ------------------------------------------------------ | 588 // -- Member Variables ------------------------------------------------------ |
| 589 | 589 |
| 590 // There is a one-to-one mapping between each of the tabs in the | 590 // There is a one-to-one mapping between each of the tabs in the |
| 591 // TabStripController (TabStripModel) and |tabs_|. Because we animate tab | 591 // TabStripController (TabStripModel) and |tabs_|. Because we animate tab |
| 592 // removal there exists a period of time where a tab is displayed but not in | 592 // removal there exists a period of time where a tab is displayed but not in |
| 593 // the model. When this occurs the tab is removed from |tabs_| and placed in | 593 // the model. When this occurs the tab is removed from |tabs_| and placed in |
| 594 // |tabs_closing_map_|. When the animation completes the tab is removed from | 594 // |tabs_closing_map_|. When the animation completes the tab is removed from |
| 595 // |tabs_closing_map_|. The painting code ensures both sets of tabs are | 595 // |tabs_closing_map_|. The painting code ensures both sets of tabs are |
| 596 // painted, and the event handling code ensures only tabs in |tabs_| are used. | 596 // painted, and the event handling code ensures only tabs in |tabs_| are used. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 bool immersive_style_; | 677 bool immersive_style_; |
| 678 | 678 |
| 679 // Our observers. | 679 // Our observers. |
| 680 typedef ObserverList<TabStripObserver> TabStripObservers; | 680 typedef ObserverList<TabStripObserver> TabStripObservers; |
| 681 TabStripObservers observers_; | 681 TabStripObservers observers_; |
| 682 | 682 |
| 683 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 683 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 684 }; | 684 }; |
| 685 | 685 |
| 686 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 686 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |