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

Side by Side Diff: chrome/browser/ui/views/toolbar/wrench_toolbar_button.h

Issue 680053003: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/toolbar/wrench_menu.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h" 11 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h"
12 #include "ui/views/controls/button/menu_button.h" 12 #include "ui/views/controls/button/menu_button.h"
13 13
14 class ToolbarView; 14 class ToolbarView;
15 15
16 // TODO(gbillock): Rename this? No longer a wrench. 16 // TODO(gbillock): Rename this? No longer a wrench.
17 class WrenchToolbarButton : public views::MenuButton, 17 class WrenchToolbarButton : public views::MenuButton,
18 public WrenchIconPainter::Delegate { 18 public WrenchIconPainter::Delegate {
19 public: 19 public:
20 explicit WrenchToolbarButton(ToolbarView* toolbar_view); 20 explicit WrenchToolbarButton(ToolbarView* toolbar_view);
21 virtual ~WrenchToolbarButton(); 21 ~WrenchToolbarButton() override;
22 22
23 void SetSeverity(WrenchIconPainter::Severity severity, bool animate); 23 void SetSeverity(WrenchIconPainter::Severity severity, bool animate);
24 24
25 // views::MenuButton: 25 // views::MenuButton:
26 virtual gfx::Size GetPreferredSize() const override; 26 gfx::Size GetPreferredSize() const override;
27 virtual void OnPaint(gfx::Canvas* canvas) override; 27 void OnPaint(gfx::Canvas* canvas) override;
28 28
29 // WrenchIconPainter::Delegate: 29 // WrenchIconPainter::Delegate:
30 virtual void ScheduleWrenchIconPaint() override; 30 void ScheduleWrenchIconPaint() override;
31 31
32 // Opens the wrench menu immediately during a drag-and-drop operation. 32 // Opens the wrench menu immediately during a drag-and-drop operation.
33 // Used only in testing. 33 // Used only in testing.
34 static bool g_open_wrench_immediately_for_testing; 34 static bool g_open_wrench_immediately_for_testing;
35 35
36 private: 36 private:
37 // views::View: 37 // views::View:
38 virtual bool GetDropFormats(int* formats, 38 bool GetDropFormats(
39 int* formats,
39 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override; 40 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
40 virtual bool AreDropTypesRequired() override; 41 bool AreDropTypesRequired() override;
41 virtual bool CanDrop(const ui::OSExchangeData& data) override; 42 bool CanDrop(const ui::OSExchangeData& data) override;
42 virtual void OnDragEntered(const ui::DropTargetEvent& event) override; 43 void OnDragEntered(const ui::DropTargetEvent& event) override;
43 virtual int OnDragUpdated(const ui::DropTargetEvent& event) override; 44 int OnDragUpdated(const ui::DropTargetEvent& event) override;
44 virtual void OnDragExited() override; 45 void OnDragExited() override;
45 virtual int OnPerformDrop(const ui::DropTargetEvent& event) override; 46 int OnPerformDrop(const ui::DropTargetEvent& event) override;
46 47
47 // Show the extension action overflow menu (which is in the app menu). 48 // Show the extension action overflow menu (which is in the app menu).
48 void ShowOverflowMenu(); 49 void ShowOverflowMenu();
49 50
50 scoped_ptr<WrenchIconPainter> wrench_icon_painter_; 51 scoped_ptr<WrenchIconPainter> wrench_icon_painter_;
51 52
52 // Our owning toolbar view. 53 // Our owning toolbar view.
53 ToolbarView* toolbar_view_; 54 ToolbarView* toolbar_view_;
54 55
55 // Whether or not we should allow dragging extension icons onto this button 56 // Whether or not we should allow dragging extension icons onto this button
56 // (in order to open the overflow in the app/wrench menu). 57 // (in order to open the overflow in the app/wrench menu).
57 bool allow_extension_dragging_; 58 bool allow_extension_dragging_;
58 59
59 // Used to spawn weak pointers for delayed tasks to open the overflow menu. 60 // Used to spawn weak pointers for delayed tasks to open the overflow menu.
60 base::WeakPtrFactory<WrenchToolbarButton> weak_factory_; 61 base::WeakPtrFactory<WrenchToolbarButton> weak_factory_;
61 62
62 DISALLOW_COPY_AND_ASSIGN(WrenchToolbarButton); 63 DISALLOW_COPY_AND_ASSIGN(WrenchToolbarButton);
63 }; 64 };
64 65
65 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_ 66 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/wrench_menu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698