| OLD | NEW |
| 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_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual gfx::Rect GetFocusBounds(); | 48 virtual gfx::Rect GetFocusBounds(); |
| 49 | 49 |
| 50 // Performs an action when user clicks on the view (on mouse-press event), or | 50 // Performs an action when user clicks on the view (on mouse-press event), or |
| 51 // presses a key when this view is in focus. Returns true if the event has | 51 // presses a key when this view is in focus. Returns true if the event has |
| 52 // been handled and an action was performed. Returns false otherwise. | 52 // been handled and an action was performed. Returns false otherwise. |
| 53 virtual bool PerformAction(const ui::Event& event) = 0; | 53 virtual bool PerformAction(const ui::Event& event) = 0; |
| 54 | 54 |
| 55 // Overridden from views::CustomButton. | 55 // Overridden from views::CustomButton. |
| 56 const char* GetClassName() const override; | 56 const char* GetClassName() const override; |
| 57 bool OnKeyPressed(const ui::KeyEvent& event) override; | 57 bool OnKeyPressed(const ui::KeyEvent& event) override; |
| 58 void GetAccessibleState(ui::AXViewState* state) override; | 58 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 59 void OnPaint(gfx::Canvas* canvas) override; | 59 void OnPaint(gfx::Canvas* canvas) override; |
| 60 void OnFocus() override; | 60 void OnFocus() override; |
| 61 void OnBlur() override; | 61 void OnBlur() override; |
| 62 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 62 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| 63 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 63 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
| 64 const override; | 64 const override; |
| 65 | 65 |
| 66 // Overridden from views::ButtonListener. | 66 // Overridden from views::ButtonListener. |
| 67 void ButtonPressed(Button* sender, const ui::Event& event) override; | 67 void ButtonPressed(Button* sender, const ui::Event& event) override; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // Used by ButtonPressed() to determine whether |this| has been destroyed as a | 70 // Used by ButtonPressed() to determine whether |this| has been destroyed as a |
| 71 // result of performing the associated action. This is necessary because in | 71 // result of performing the associated action. This is necessary because in |
| 72 // the not-destroyed case ButtonPressed() uses member variables. | 72 // the not-destroyed case ButtonPressed() uses member variables. |
| 73 bool* destroyed_; | 73 bool* destroyed_; |
| 74 | 74 |
| 75 SystemTrayItem* owner_; | 75 SystemTrayItem* owner_; |
| 76 | 76 |
| 77 base::string16 accessible_name_; | 77 base::string16 accessible_name_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(ActionableView); | 79 DISALLOW_COPY_AND_ASSIGN(ActionableView); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace ash | 82 } // namespace ash |
| 83 | 83 |
| 84 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ | 84 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |
| OLD | NEW |