| 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_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/common/system/tray/special_popup_row.h" | 11 #include "ash/common/system/tray/special_popup_row.h" |
| 12 #include "ash/common/system/tray/tray_constants.h" | 12 #include "ash/common/system/tray/tray_constants.h" |
| 13 #include "ash/common/system/tray/view_click_listener.h" | 13 #include "ash/common/system/tray/view_click_listener.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "ui/views/controls/button/button.h" | 15 #include "ui/views/controls/button/button.h" |
| 16 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class OneShotTimer; | 19 class OneShotTimer; |
| 20 } // namespace base | 20 } // namespace base |
| 21 | 21 |
| 22 namespace views { | 22 namespace views { |
| 23 class BoxLayout; | 23 class BoxLayout; |
| 24 class CustomButton; | 24 class CustomButton; |
| 25 class Label; | |
| 26 class ProgressBar; | 25 class ProgressBar; |
| 27 } // namespace views | 26 } // namespace views |
| 28 | 27 |
| 29 namespace ash { | 28 namespace ash { |
| 30 namespace test { | 29 namespace test { |
| 31 class TrayDetailsViewTest; | 30 class TrayDetailsViewTest; |
| 32 } // namespace test | 31 } // namespace test |
| 33 | 32 |
| 34 class FixedSizedScrollView; | 33 class FixedSizedScrollView; |
| 35 class ScrollBorder; | 34 class ScrollBorder; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // respectively, used in the material design top-most header row. The caller | 88 // respectively, used in the material design top-most header row. The caller |
| 90 // assumes ownership of the returned buttons. | 89 // assumes ownership of the returned buttons. |
| 91 views::CustomButton* CreateSettingsButton(LoginStatus status); | 90 views::CustomButton* CreateSettingsButton(LoginStatus status); |
| 92 views::CustomButton* CreateHelpButton(LoginStatus status); | 91 views::CustomButton* CreateHelpButton(LoginStatus status); |
| 93 | 92 |
| 94 TriView* tri_view() { return tri_view_; } | 93 TriView* tri_view() { return tri_view_; } |
| 95 | 94 |
| 96 private: | 95 private: |
| 97 friend class test::TrayDetailsViewTest; | 96 friend class test::TrayDetailsViewTest; |
| 98 | 97 |
| 99 // views::View: | |
| 100 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | |
| 101 | |
| 102 // Updates the style of |label_| based on the current native theme, if it | |
| 103 // exists. Only used for material design. | |
| 104 void UpdateStyle(); | |
| 105 | |
| 106 // Overridden to handle clicks on subclass-specific views. | 98 // Overridden to handle clicks on subclass-specific views. |
| 107 virtual void HandleViewClicked(views::View* view); | 99 virtual void HandleViewClicked(views::View* view); |
| 108 | 100 |
| 109 // Overridden to handle button presses on subclass-specific buttons. | 101 // Overridden to handle button presses on subclass-specific buttons. |
| 110 virtual void HandleButtonPressed(views::Button* sender, | 102 virtual void HandleButtonPressed(views::Button* sender, |
| 111 const ui::Event& event); | 103 const ui::Event& event); |
| 112 | 104 |
| 113 // Creates and adds subclass-specific buttons to the title row. | 105 // Creates and adds subclass-specific buttons to the title row. |
| 114 virtual void CreateExtraTitleRowButtons(); | 106 virtual void CreateExtraTitleRowButtons(); |
| 115 | 107 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 134 SpecialPopupRow* title_row_; // Not used in material design. | 126 SpecialPopupRow* title_row_; // Not used in material design. |
| 135 FixedSizedScrollView* scroller_; | 127 FixedSizedScrollView* scroller_; |
| 136 views::View* scroll_content_; | 128 views::View* scroll_content_; |
| 137 views::ProgressBar* progress_bar_; | 129 views::ProgressBar* progress_bar_; |
| 138 | 130 |
| 139 ScrollBorder* scroll_border_; // Weak reference | 131 ScrollBorder* scroll_border_; // Weak reference |
| 140 | 132 |
| 141 // The container view for the top-most title row in material design. | 133 // The container view for the top-most title row in material design. |
| 142 TriView* tri_view_; | 134 TriView* tri_view_; |
| 143 | 135 |
| 144 // The label used in the top-most title row for material design. | |
| 145 views::Label* label_; | |
| 146 | |
| 147 // The back button that appears in the material design title row. Not owned. | 136 // The back button that appears in the material design title row. Not owned. |
| 148 views::Button* back_button_; | 137 views::Button* back_button_; |
| 149 | 138 |
| 150 // Used to delay the transition to the default view. | 139 // Used to delay the transition to the default view. |
| 151 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; | 140 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; |
| 152 | 141 |
| 153 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); | 142 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); |
| 154 }; | 143 }; |
| 155 | 144 |
| 156 } // namespace ash | 145 } // namespace ash |
| 157 | 146 |
| 158 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 147 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| OLD | NEW |