| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TRAY_POPUP_UTILS_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| 7 | 7 |
| 8 #include "ash/common/login_status.h" | 8 #include "ash/common/login_status.h" |
| 9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/tray_popup_ink_drop_style.h" | 10 #include "ash/common/system/tray/tray_popup_ink_drop_style.h" |
| 11 #include "ash/common/system/tray/tri_view.h" | 11 #include "ash/common/system/tray/tri_view.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class ButtonListener; | 15 class ButtonListener; |
| 16 class ImageView; | 16 class ImageView; |
| 17 class InkDrop; | 17 class InkDrop; |
| 18 class InkDropRipple; | 18 class InkDropRipple; |
| 19 class InkDropHighlight; | 19 class InkDropHighlight; |
| 20 class InkDropHostView; | 20 class InkDropHostView; |
| 21 class InkDropMask; | 21 class InkDropMask; |
| 22 class Label; | 22 class Label; |
| 23 class LabelButton; | 23 class LabelButton; |
| 24 class Painter; |
| 24 class Separator; | 25 class Separator; |
| 25 class Slider; | 26 class Slider; |
| 26 class SliderListener; | 27 class SliderListener; |
| 27 class ToggleButton; | 28 class ToggleButton; |
| 28 } // namespace views | 29 } // namespace views |
| 29 | 30 |
| 30 namespace ash { | 31 namespace ash { |
| 31 | 32 |
| 32 // Factory/utility functions used by the system menu. | 33 // Factory/utility functions used by the system menu. |
| 33 class TrayPopupUtils { | 34 class TrayPopupUtils { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 101 |
| 101 // Returns a slider configured for proper layout within a TriView container | 102 // Returns a slider configured for proper layout within a TriView container |
| 102 // with a FillLayout. | 103 // with a FillLayout. |
| 103 static views::Slider* CreateSlider(views::SliderListener* listener); | 104 static views::Slider* CreateSlider(views::SliderListener* listener); |
| 104 | 105 |
| 105 // Returns a ToggleButton that has been configured for system menu layout. | 106 // Returns a ToggleButton that has been configured for system menu layout. |
| 106 static views::ToggleButton* CreateToggleButton( | 107 static views::ToggleButton* CreateToggleButton( |
| 107 views::ButtonListener* listener, | 108 views::ButtonListener* listener, |
| 108 int accessible_name_id); | 109 int accessible_name_id); |
| 109 | 110 |
| 111 // Creates a default focus painter used for most things in tray popups. |
| 112 static std::unique_ptr<views::Painter> CreateFocusPainter(); |
| 113 |
| 110 // Sets up |view| to be a sticky header in a tray detail scroll view. | 114 // Sets up |view| to be a sticky header in a tray detail scroll view. |
| 111 static void ConfigureAsStickyHeader(views::View* view); | 115 static void ConfigureAsStickyHeader(views::View* view); |
| 112 | 116 |
| 113 // Configures |container_view| just like CreateDefaultRowView() would | 117 // Configures |container_view| just like CreateDefaultRowView() would |
| 114 // configure |container| on its returned TriView. To be used when mutliple | 118 // configure |container| on its returned TriView. To be used when mutliple |
| 115 // targetable areas are required within a single row. | 119 // targetable areas are required within a single row. |
| 116 static void ConfigureContainer(TriView::Container container, | 120 static void ConfigureContainer(TriView::Container container, |
| 117 views::View* container_view); | 121 views::View* container_view); |
| 118 | 122 |
| 119 // Creates a button for use in the system menu that only has a visible border | 123 // Creates a button for use in the system menu that only has a visible border |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // |ink_drop_style|. | 203 // |ink_drop_style|. |
| 200 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, | 204 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, |
| 201 const views::View* host); | 205 const views::View* host); |
| 202 | 206 |
| 203 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); | 207 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); |
| 204 }; | 208 }; |
| 205 | 209 |
| 206 } // namespace ash | 210 } // namespace ash |
| 207 | 211 |
| 208 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 212 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| OLD | NEW |