| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // the not-destroyed case ButtonPressed() uses member variables. | 73 // the not-destroyed case ButtonPressed() uses member variables. |
| 74 bool* destroyed_; | 74 bool* destroyed_; |
| 75 | 75 |
| 76 SystemTrayItem* owner_; | 76 SystemTrayItem* owner_; |
| 77 | 77 |
| 78 base::string16 accessible_name_; | 78 base::string16 accessible_name_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(ActionableView); | 80 DISALLOW_COPY_AND_ASSIGN(ActionableView); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // An ActionableView that can be used with a ButtonListener instead of having to |
| 84 // extend ActionableView and override PerformAction(). |
| 85 class ASH_EXPORT ButtonListenerActionableView : public ActionableView { |
| 86 public: |
| 87 ButtonListenerActionableView(SystemTrayItem* owner, |
| 88 views::ButtonListener* listener); |
| 89 |
| 90 // ActionableView: |
| 91 bool PerformAction(const ui::Event& event) override; |
| 92 |
| 93 private: |
| 94 views::ButtonListener* listener_; |
| 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(ButtonListenerActionableView); |
| 97 }; |
| 98 |
| 83 } // namespace ash | 99 } // namespace ash |
| 84 | 100 |
| 85 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ | 101 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |
| OLD | NEW |