| 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 "ash/common/system/tray/tray_popup_ink_drop_style.h" | 9 #include "ash/common/system/tray/tray_popup_ink_drop_style.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 void SetAccessibleName(const base::string16& name); | 37 void SetAccessibleName(const base::string16& name); |
| 38 const base::string16& accessible_name() const { return accessible_name_; } | 38 const base::string16& accessible_name() const { return accessible_name_; } |
| 39 | 39 |
| 40 // Closes the system tray bubble. The |owner_| must not be nullptr. | 40 // Closes the system tray bubble. The |owner_| must not be nullptr. |
| 41 void CloseSystemBubble(); | 41 void CloseSystemBubble(); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 SystemTrayItem* owner() { return owner_; } | 44 SystemTrayItem* owner() { return owner_; } |
| 45 | 45 |
| 46 void OnPaintFocus(gfx::Canvas* canvas); | 46 // Draws focus rectangle on the canvas. |
| 47 // Default implementation draws the focus rectangle with certain inset and |
| 48 // color. Subclasses can override to change the default settings. |
| 49 virtual void OnPaintFocus(gfx::Canvas* canvas); |
| 47 | 50 |
| 48 // Returns the bounds to paint the focus rectangle in. | 51 // Returns the bounds to paint the focus rectangle in. |
| 49 virtual gfx::Rect GetFocusBounds(); | 52 virtual gfx::Rect GetFocusBounds(); |
| 50 | 53 |
| 51 // Performs an action when user clicks on the view (on mouse-press event), or | 54 // Performs an action when user clicks on the view (on mouse-press event), or |
| 52 // presses a key when this view is in focus. Returns true if the event has | 55 // presses a key when this view is in focus. Returns true if the event has |
| 53 // been handled and an action was performed. Returns false otherwise. | 56 // been handled and an action was performed. Returns false otherwise. |
| 54 virtual bool PerformAction(const ui::Event& event) = 0; | 57 virtual bool PerformAction(const ui::Event& event) = 0; |
| 55 | 58 |
| 56 // Called after PerformAction() to act upon its result, including showing | 59 // Called after PerformAction() to act upon its result, including showing |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 109 |
| 107 private: | 110 private: |
| 108 views::ButtonListener* listener_; | 111 views::ButtonListener* listener_; |
| 109 | 112 |
| 110 DISALLOW_COPY_AND_ASSIGN(ButtonListenerActionableView); | 113 DISALLOW_COPY_AND_ASSIGN(ButtonListenerActionableView); |
| 111 }; | 114 }; |
| 112 | 115 |
| 113 } // namespace ash | 116 } // namespace ash |
| 114 | 117 |
| 115 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ | 118 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |
| OLD | NEW |