OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TRAY_VIEWS_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ |
6 #define ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/gfx/font.h" | 9 #include "ui/gfx/font.h" |
10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
11 #include "ui/views/controls/image_view.h" | 11 #include "ui/views/controls/image_view.h" |
12 #include "ui/views/controls/scroll_view.h" | 12 #include "ui/views/controls/scroll_view.h" |
| 13 #include "ui/views/controls/slider.h" |
13 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
14 | 15 |
15 class SkBitmap; | 16 class SkBitmap; |
16 typedef unsigned int SkColor; | 17 typedef unsigned int SkColor; |
17 | 18 |
18 namespace views { | 19 namespace views { |
19 class Label; | 20 class Label; |
20 } | 21 } |
21 | 22 |
22 namespace ash { | 23 namespace ash { |
(...skipping 25 matching lines...) Expand all Loading... |
48 | 49 |
49 protected: | 50 protected: |
50 // Performs an action when user clicks on the view (on mouse-press event), or | 51 // 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 | 52 // 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. | 53 // been handled and an action was performed. Returns false otherwise. |
53 virtual bool PerformAction(const views::Event& event) = 0; | 54 virtual bool PerformAction(const views::Event& event) = 0; |
54 | 55 |
55 // Overridden from views::View. | 56 // Overridden from views::View. |
56 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | 57 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
57 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 58 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
| 59 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; |
58 | 60 |
59 private: | 61 private: |
60 DISALLOW_COPY_AND_ASSIGN(ActionableView); | 62 DISALLOW_COPY_AND_ASSIGN(ActionableView); |
61 }; | 63 }; |
62 | 64 |
63 class ViewClickListener { | 65 class ViewClickListener { |
64 public: | 66 public: |
65 virtual ~ViewClickListener() {} | 67 virtual ~ViewClickListener() {} |
66 virtual void ClickedOn(views::View* sender) = 0; | 68 virtual void ClickedOn(views::View* sender) = 0; |
67 }; | 69 }; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 views::View* CreateDetailedHeaderEntry(int string_id, | 137 views::View* CreateDetailedHeaderEntry(int string_id, |
136 ViewClickListener* listener); | 138 ViewClickListener* listener); |
137 | 139 |
138 // Sets up a Label properly for the tray (sets color, font etc.). | 140 // Sets up a Label properly for the tray (sets color, font etc.). |
139 void SetupLabelForTray(views::Label* label); | 141 void SetupLabelForTray(views::Label* label); |
140 | 142 |
141 } // namespace internal | 143 } // namespace internal |
142 } // namespace ash | 144 } // namespace ash |
143 | 145 |
144 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ | 146 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ |
OLD | NEW |