Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 void OnPaintFocus(gfx::Canvas* canvas); | 45 void OnPaintFocus(gfx::Canvas* canvas); |
| 46 | 46 |
| 47 // Returns the bounds to paint the focus rectangle in. | 47 // Returns the bounds to paint the focus rectangle in. |
| 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 // Called after PerformAction() to act upon its result, including showing | |
| 56 // appropriate ink drop ripple. By default shows triggered ripple if action is | |
| 57 // performed or hides existing ripple if no action is performed. Subclassed | |
| 58 // can override to change the default behavior. | |
|
bruthig
2016/11/11 17:30:40
nit: Can you also note that this will not be calle
mohsen
2016/11/11 22:37:24
Done.
| |
| 59 virtual void HandlePerformActionResult(bool action_performed, | |
| 60 const ui::Event& event); | |
| 61 | |
| 55 // Overridden from views::CustomButton. | 62 // Overridden from views::CustomButton. |
| 56 const char* GetClassName() const override; | 63 const char* GetClassName() const override; |
| 57 bool OnKeyPressed(const ui::KeyEvent& event) override; | 64 bool OnKeyPressed(const ui::KeyEvent& event) override; |
| 58 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; | 65 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 59 void OnPaint(gfx::Canvas* canvas) override; | 66 void OnPaint(gfx::Canvas* canvas) override; |
| 60 void OnFocus() override; | 67 void OnFocus() override; |
| 61 void OnBlur() override; | 68 void OnBlur() override; |
| 62 std::unique_ptr<views::InkDrop> CreateInkDrop() override; | 69 std::unique_ptr<views::InkDrop> CreateInkDrop() override; |
| 63 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 70 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| 64 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 71 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 76 SystemTrayItem* owner_; | 83 SystemTrayItem* owner_; |
| 77 | 84 |
| 78 base::string16 accessible_name_; | 85 base::string16 accessible_name_; |
| 79 | 86 |
| 80 DISALLOW_COPY_AND_ASSIGN(ActionableView); | 87 DISALLOW_COPY_AND_ASSIGN(ActionableView); |
| 81 }; | 88 }; |
| 82 | 89 |
| 83 } // namespace ash | 90 } // namespace ash |
| 84 | 91 |
| 85 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ | 92 #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |
| OLD | NEW |