| 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 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/wm/shelf_types.h" |
| 9 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
| 10 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 11 #include "ui/views/controls/button/image_button.h" | 12 #include "ui/views/controls/button/image_button.h" |
| 12 #include "ui/views/controls/button/text_button.h" | 13 #include "ui/views/controls/button/text_button.h" |
| 13 #include "ui/views/controls/image_view.h" | 14 #include "ui/views/controls/image_view.h" |
| 14 #include "ui/views/controls/scroll_view.h" | 15 #include "ui/views/controls/scroll_view.h" |
| 15 #include "ui/views/controls/slider.h" | 16 #include "ui/views/controls/slider.h" |
| 16 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 17 | 18 |
| 18 typedef unsigned int SkColor; | 19 typedef unsigned int SkColor; |
| 19 | 20 |
| 20 namespace gfx { | 21 namespace gfx { |
| 21 class ImageSkia; | 22 class ImageSkia; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace views { | 25 namespace views { |
| 25 class Label; | 26 class Label; |
| 26 class BoxLayout; | 27 class BoxLayout; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace ash { | 30 namespace ash { |
| 30 namespace internal { | 31 namespace internal { |
| 31 | 32 |
| 33 class TrayItemView; |
| 34 |
| 32 // An image view with a specified width and height (kTrayPopupDetailsIconWidth). | 35 // An image view with a specified width and height (kTrayPopupDetailsIconWidth). |
| 33 // If the specified width or height is zero, then the image size is used for | 36 // If the specified width or height is zero, then the image size is used for |
| 34 // that dimension. | 37 // that dimension. |
| 35 class FixedSizedImageView : public views::ImageView { | 38 class FixedSizedImageView : public views::ImageView { |
| 36 public: | 39 public: |
| 37 FixedSizedImageView(int width, int height); | 40 FixedSizedImageView(int width, int height); |
| 38 virtual ~FixedSizedImageView(); | 41 virtual ~FixedSizedImageView(); |
| 39 | 42 |
| 40 private: | 43 private: |
| 41 virtual gfx::Size GetPreferredSize() OVERRIDE; | 44 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 251 |
| 249 views::View* content_; | 252 views::View* content_; |
| 250 views::View* button_container_; | 253 views::View* button_container_; |
| 251 views::Label* text_label_; | 254 views::Label* text_label_; |
| 252 DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow); | 255 DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow); |
| 253 }; | 256 }; |
| 254 | 257 |
| 255 // Sets up a Label properly for the tray (sets color, font etc.). | 258 // Sets up a Label properly for the tray (sets color, font etc.). |
| 256 void SetupLabelForTray(views::Label* label); | 259 void SetupLabelForTray(views::Label* label); |
| 257 | 260 |
| 261 // TODO(jennyz): refactor these two functions to SystemTrayItem. |
| 262 // Sets the empty border of an image tray item for adjusting the space |
| 263 // around it. |
| 264 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment); |
| 265 // Sets the empty border around a label tray item for adjusting the space |
| 266 // around it. |
| 267 void SetTrayLabelItemBorder(TrayItemView* tray_view, |
| 268 ShelfAlignment alignment); |
| 269 |
| 258 } // namespace internal | 270 } // namespace internal |
| 259 } // namespace ash | 271 } // namespace ash |
| 260 | 272 |
| 261 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ | 273 #endif // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_ |
| OLD | NEW |