| 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/login_status.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 "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
| 17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 class BoxLayout; | 20 class BoxLayout; |
| 21 class CustomButton; | 21 class CustomButton; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // ViewClickListener: | 42 // ViewClickListener: |
| 43 // Don't override this --- override HandleViewClicked. | 43 // Don't override this --- override HandleViewClicked. |
| 44 void OnViewClicked(views::View* sender) final; | 44 void OnViewClicked(views::View* sender) final; |
| 45 | 45 |
| 46 // views::ButtonListener: | 46 // views::ButtonListener: |
| 47 // Don't override this --- override HandleButtonPressed. | 47 // Don't override this --- override HandleButtonPressed. |
| 48 void ButtonPressed(views::Button* sender, const ui::Event& event) final; | 48 void ButtonPressed(views::Button* sender, const ui::Event& event) final; |
| 49 | 49 |
| 50 SystemTrayItem* owner() { return owner_; } | 50 SystemTrayItem* owner() { return owner_; } |
| 51 SpecialPopupRow* title_row() { return title_row_; } | |
| 52 views::ScrollView* scroller() { return scroller_; } | 51 views::ScrollView* scroller() { return scroller_; } |
| 53 views::View* scroll_content() { return scroll_content_; } | 52 views::View* scroll_content() { return scroll_content_; } |
| 54 | 53 |
| 55 protected: | 54 protected: |
| 56 // views::View: | 55 // views::View: |
| 57 void Layout() override; | 56 void Layout() override; |
| 58 int GetHeightForWidth(int width) const override; | 57 int GetHeightForWidth(int width) const override; |
| 59 void OnPaintBorder(gfx::Canvas* canvas) override; | |
| 60 | 58 |
| 61 // Exposes the layout manager of this view to give control to subclasses. | 59 // Exposes the layout manager of this view to give control to subclasses. |
| 62 views::BoxLayout* box_layout() { return box_layout_; } | 60 views::BoxLayout* box_layout() { return box_layout_; } |
| 63 | 61 |
| 64 // Creates the row containing the back button and title. For material design | 62 // Creates the row containing the back button and title. For material design |
| 65 // this appears at the top of the view, for non-material design it appears | 63 // this appears at the top of the view, for non-material design it appears |
| 66 // at the bottom. | 64 // at the bottom. |
| 67 void CreateTitleRow(int string_id); | 65 void CreateTitleRow(int string_id); |
| 68 | 66 |
| 69 // Creates a scrollable list. The list has a border at the bottom if there is | 67 // Creates a scrollable list. The list has a border at the bottom if there is |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Actually transitions to the default view. | 112 // Actually transitions to the default view. |
| 115 void DoTransitionToDefaultView(); | 113 void DoTransitionToDefaultView(); |
| 116 | 114 |
| 117 // Helper function which creates and returns the back button used in the | 115 // Helper function which creates and returns the back button used in the |
| 118 // material design top-most header row. The caller assumes ownership of the | 116 // material design top-most header row. The caller assumes ownership of the |
| 119 // returned button. | 117 // returned button. |
| 120 views::Button* CreateBackButton(); | 118 views::Button* CreateBackButton(); |
| 121 | 119 |
| 122 SystemTrayItem* owner_; | 120 SystemTrayItem* owner_; |
| 123 views::BoxLayout* box_layout_; | 121 views::BoxLayout* box_layout_; |
| 124 SpecialPopupRow* title_row_; // Not used in material design. | |
| 125 views::ScrollView* scroller_; | 122 views::ScrollView* scroller_; |
| 126 views::View* scroll_content_; | 123 views::View* scroll_content_; |
| 127 views::ProgressBar* progress_bar_; | 124 views::ProgressBar* progress_bar_; |
| 128 | 125 |
| 129 ScrollBorder* scroll_border_; // Weak reference | 126 ScrollBorder* scroll_border_; // Weak reference |
| 130 | 127 |
| 131 // The container view for the top-most title row in material design. | 128 // The container view for the top-most title row in material design. |
| 132 TriView* tri_view_; | 129 TriView* tri_view_; |
| 133 | 130 |
| 134 // The back button that appears in the material design title row. Not owned. | 131 // The back button that appears in the material design title row. Not owned. |
| 135 views::Button* back_button_; | 132 views::Button* back_button_; |
| 136 | 133 |
| 137 // Used to delay the transition to the default view. | 134 // Used to delay the transition to the default view. |
| 138 base::OneShotTimer transition_delay_timer_; | 135 base::OneShotTimer transition_delay_timer_; |
| 139 | 136 |
| 140 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); | 137 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); |
| 141 }; | 138 }; |
| 142 | 139 |
| 143 } // namespace ash | 140 } // namespace ash |
| 144 | 141 |
| 145 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 142 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| OLD | NEW |