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/button/image_button.h" |
11 #include "ui/views/controls/button/text_button.h" | 12 #include "ui/views/controls/button/text_button.h" |
12 #include "ui/views/controls/image_view.h" | 13 #include "ui/views/controls/image_view.h" |
13 #include "ui/views/controls/scroll_view.h" | 14 #include "ui/views/controls/scroll_view.h" |
14 #include "ui/views/controls/slider.h" | 15 #include "ui/views/controls/slider.h" |
15 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
16 | 17 |
17 class SkBitmap; | 18 class SkBitmap; |
18 typedef unsigned int SkColor; | 19 typedef unsigned int SkColor; |
19 | 20 |
20 namespace views { | 21 namespace views { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 public: | 168 public: |
168 TrayPopupTextButtonContainer(); | 169 TrayPopupTextButtonContainer(); |
169 virtual ~TrayPopupTextButtonContainer(); | 170 virtual ~TrayPopupTextButtonContainer(); |
170 | 171 |
171 void AddTextButton(TrayPopupTextButton* button); | 172 void AddTextButton(TrayPopupTextButton* button); |
172 | 173 |
173 private: | 174 private: |
174 DISALLOW_COPY_AND_ASSIGN(TrayPopupTextButtonContainer); | 175 DISALLOW_COPY_AND_ASSIGN(TrayPopupTextButtonContainer); |
175 }; | 176 }; |
176 | 177 |
| 178 // A ToggleImageButton with fixed size, paddings and hover effects. These |
| 179 // buttons are used in the header. |
| 180 class TrayPopupHeaderButton : public views::ToggleImageButton { |
| 181 public: |
| 182 TrayPopupHeaderButton(views::ButtonListener* listener, |
| 183 int enabled_resource_id, |
| 184 int disabled_resource_id); |
| 185 virtual ~TrayPopupHeaderButton(); |
| 186 |
| 187 private: |
| 188 // Overridden from views::View. |
| 189 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 190 virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE; |
| 191 |
| 192 // Overridden from views::CustomButton. |
| 193 virtual void StateChanged() OVERRIDE; |
| 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(TrayPopupHeaderButton); |
| 196 }; |
| 197 |
177 // Creates a container for the various detailed popups. Clicking on the view | 198 // Creates a container for the various detailed popups. Clicking on the view |
178 // triggers the callback in ViewClickListener. | 199 // triggers the callback in ViewClickListener. |
179 views::View* CreateDetailedHeaderEntry(int string_id, | 200 views::View* CreateDetailedHeaderEntry(int string_id, |
180 ViewClickListener* listener); | 201 ViewClickListener* listener); |
181 | 202 |
182 // Sets up a Label properly for the tray (sets color, font etc.). | 203 // Sets up a Label properly for the tray (sets color, font etc.). |
183 void SetupLabelForTray(views::Label* label); | 204 void SetupLabelForTray(views::Label* label); |
184 | 205 |
185 } // namespace internal | 206 } // namespace internal |
186 } // namespace ash | 207 } // namespace ash |
187 | 208 |
188 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ | 209 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ |
OLD | NEW |