Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.h

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: fix cros build Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // A View that represents the TabStripModel. The TabStrip has the 46 // A View that represents the TabStripModel. The TabStrip has the
47 // following responsibilities: 47 // following responsibilities:
48 // - It implements the TabStripModelObserver interface, and acts as a 48 // - It implements the TabStripModelObserver interface, and acts as a
49 // container for Tabs, and is also responsible for creating them. 49 // container for Tabs, and is also responsible for creating them.
50 // - It takes part in Tab Drag & Drop with Tab, TabDragHelper and 50 // - It takes part in Tab Drag & Drop with Tab, TabDragHelper and
51 // DraggedTab, focusing on tasks that require reshuffling other tabs 51 // DraggedTab, focusing on tasks that require reshuffling other tabs
52 // in response to dragged tabs. 52 // in response to dragged tabs.
53 // 53 //
54 /////////////////////////////////////////////////////////////////////////////// 54 ///////////////////////////////////////////////////////////////////////////////
55 class TabStrip : public views::View, 55 class TabStrip : public views::View,
56 public views::ButtonListener, 56 public views::ImageButtonDelegate,
57 public views::MouseWatcherListener, 57 public views::MouseWatcherListener,
58 public views::ViewTargeterDelegate, 58 public views::ViewTargeterDelegate,
59 public TabController { 59 public TabController {
60 public: 60 public:
61 explicit TabStrip(TabStripController* controller); 61 explicit TabStrip(TabStripController* controller);
62 ~TabStrip() override; 62 ~TabStrip() override;
63 63
64 // Add and remove observers to changes within this TabStrip. 64 // Add and remove observers to changes within this TabStrip.
65 void AddObserver(TabStripObserver* observer); 65 void AddObserver(TabStripObserver* observer);
66 void RemoveObserver(TabStripObserver* observer); 66 void RemoveObserver(TabStripObserver* observer);
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 void SwapLayoutIfNecessary(); 532 void SwapLayoutIfNecessary();
533 533
534 // Returns true if |touch_layout_| is needed. 534 // Returns true if |touch_layout_| is needed.
535 bool NeedsTouchLayout() const; 535 bool NeedsTouchLayout() const;
536 536
537 // Sets the value of |reset_to_shrink_on_exit_|. If true |mouse_watcher_| is 537 // Sets the value of |reset_to_shrink_on_exit_|. If true |mouse_watcher_| is
538 // used to track when the mouse truly exits the tabstrip and the stacked 538 // used to track when the mouse truly exits the tabstrip and the stacked
539 // layout is reset. 539 // layout is reset.
540 void SetResetToShrinkOnExit(bool value); 540 void SetResetToShrinkOnExit(bool value);
541 541
542 // views::ButtonListener implementation: 542 // views::ImageButtonDelegate:
543 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 543 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
544 544
545 // View overrides. 545 // View overrides.
546 const views::View* GetViewByID(int id) const override; 546 const views::View* GetViewByID(int id) const override;
547 bool OnMousePressed(const ui::MouseEvent& event) override; 547 bool OnMousePressed(const ui::MouseEvent& event) override;
548 bool OnMouseDragged(const ui::MouseEvent& event) override; 548 bool OnMouseDragged(const ui::MouseEvent& event) override;
549 void OnMouseReleased(const ui::MouseEvent& event) override; 549 void OnMouseReleased(const ui::MouseEvent& event) override;
550 void OnMouseCaptureLost() override; 550 void OnMouseCaptureLost() override;
551 void OnMouseMoved(const ui::MouseEvent& event) override; 551 void OnMouseMoved(const ui::MouseEvent& event) override;
552 void OnMouseEntered(const ui::MouseEvent& event) override; 552 void OnMouseEntered(const ui::MouseEvent& event) override;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 base::OneShotTimer resize_layout_timer_; 644 base::OneShotTimer resize_layout_timer_;
645 645
646 // Our observers. 646 // Our observers.
647 typedef base::ObserverList<TabStripObserver> TabStripObservers; 647 typedef base::ObserverList<TabStripObserver> TabStripObservers;
648 TabStripObservers observers_; 648 TabStripObservers observers_;
649 649
650 DISALLOW_COPY_AND_ASSIGN(TabStrip); 650 DISALLOW_COPY_AND_ASSIGN(TabStrip);
651 }; 651 };
652 652
653 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ 653 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698