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

Side by Side Diff: ash/system/tray/actionable_view.h

Issue 685483004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 | « no previous file | ash/system/tray/default_system_tray_delegate.cc » ('j') | 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 ASH_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ 5 #ifndef ASH_SYSTEM_TRAY_ACTIONABLE_VIEW_H_
6 #define ASH_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ 6 #define ASH_SYSTEM_TRAY_ACTIONABLE_VIEW_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace ash { 13 namespace ash {
14 14
15 // A focusable view that performs an action when user clicks on it, or presses 15 // A focusable view that performs an action when user clicks on it, or presses
16 // enter or space when focused. Note that the action is triggered on mouse-up, 16 // enter or space when focused. Note that the action is triggered on mouse-up,
17 // instead of on mouse-down. So if user presses the mouse on the view, then 17 // instead of on mouse-down. So if user presses the mouse on the view, then
18 // moves the mouse out of the view and then releases, then the action will not 18 // moves the mouse out of the view and then releases, then the action will not
19 // be performed. 19 // be performed.
20 // Exported for SystemTray. 20 // Exported for SystemTray.
21 class ASH_EXPORT ActionableView : public views::View { 21 class ASH_EXPORT ActionableView : public views::View {
22 public: 22 public:
23 static const char kViewClassName[]; 23 static const char kViewClassName[];
24 24
25 ActionableView(); 25 ActionableView();
26 26
27 virtual ~ActionableView(); 27 ~ActionableView() override;
28 28
29 void SetAccessibleName(const base::string16& name); 29 void SetAccessibleName(const base::string16& name);
30 const base::string16& accessible_name() const { return accessible_name_; } 30 const base::string16& accessible_name() const { return accessible_name_; }
31 31
32 protected: 32 protected:
33 void OnPaintFocus(gfx::Canvas* canvas); 33 void OnPaintFocus(gfx::Canvas* canvas);
34 34
35 // Returns the bounds to paint the focus rectangle in. 35 // Returns the bounds to paint the focus rectangle in.
36 virtual gfx::Rect GetFocusBounds(); 36 virtual gfx::Rect GetFocusBounds();
37 37
38 // Performs an action when user clicks on the view (on mouse-press event), or 38 // Performs an action when user clicks on the view (on mouse-press event), or
39 // presses a key when this view is in focus. Returns true if the event has 39 // presses a key when this view is in focus. Returns true if the event has
40 // been handled and an action was performed. Returns false otherwise. 40 // been handled and an action was performed. Returns false otherwise.
41 virtual bool PerformAction(const ui::Event& event) = 0; 41 virtual bool PerformAction(const ui::Event& event) = 0;
42 42
43 // Overridden from views::View. 43 // Overridden from views::View.
44 virtual const char* GetClassName() const override; 44 const char* GetClassName() const override;
45 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; 45 bool OnKeyPressed(const ui::KeyEvent& event) override;
46 virtual bool OnMousePressed(const ui::MouseEvent& event) override; 46 bool OnMousePressed(const ui::MouseEvent& event) override;
47 virtual void OnMouseReleased(const ui::MouseEvent& event) override; 47 void OnMouseReleased(const ui::MouseEvent& event) override;
48 virtual void OnMouseCaptureLost() override; 48 void OnMouseCaptureLost() override;
49 virtual void GetAccessibleState(ui::AXViewState* state) override; 49 void GetAccessibleState(ui::AXViewState* state) override;
50 virtual void OnPaint(gfx::Canvas* canvas) override; 50 void OnPaint(gfx::Canvas* canvas) override;
51 virtual void OnFocus() override; 51 void OnFocus() override;
52 virtual void OnBlur() override; 52 void OnBlur() override;
53 53
54 // Overridden from ui::EventHandler. 54 // Overridden from ui::EventHandler.
55 virtual void OnGestureEvent(ui::GestureEvent* event) override; 55 void OnGestureEvent(ui::GestureEvent* event) override;
56 56
57 private: 57 private:
58 base::string16 accessible_name_; 58 base::string16 accessible_name_;
59 bool has_capture_; 59 bool has_capture_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(ActionableView); 61 DISALLOW_COPY_AND_ASSIGN(ActionableView);
62 }; 62 };
63 63
64 } // namespace ash 64 } // namespace ash
65 65
66 #endif // ASH_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ 66 #endif // ASH_SYSTEM_TRAY_ACTIONABLE_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/default_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698