Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: ash/common/system/tray/tray_details_view.h

Issue 2497813002: Modify Ash MD system menu layout for title rows (Closed)
Patch Set: self review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/system/tray/special_popup_row.h" 9 #include "ash/common/system/tray/special_popup_row.h"
10 #include "ash/common/system/tray/system_menu_button.h"
bruthig 2016/11/14 04:39:11 nit: Is this needed?
tdanderson 2016/11/14 19:24:59 Done.
11 #include "ash/common/system/tray/tri_view.h"
bruthig 2016/11/14 04:39:11 nit: This could be a forward declaration.
tdanderson 2016/11/14 19:24:59 Done.
10 #include "ash/common/system/tray/view_click_listener.h" 12 #include "ash/common/system/tray/view_click_listener.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "ui/views/controls/button/button.h" 14 #include "ui/views/controls/button/button.h"
13 #include "ui/views/view.h" 15 #include "ui/views/view.h"
14 16
15 namespace views { 17 namespace views {
16 class BoxLayout; 18 class BoxLayout;
19 class Label;
20 class ProgressBar;
17 class ScrollView; 21 class ScrollView;
18 class ProgressBar;
19 } // namespace views 22 } // namespace views
20 23
21 namespace ash { 24 namespace ash {
22 namespace test { 25 namespace test {
23 class TrayDetailsViewTest; 26 class TrayDetailsViewTest;
24 } // namespace test 27 } // namespace test
25 28
26 class FixedSizedScrollView; 29 class FixedSizedScrollView;
27 class ScrollBorder; 30 class ScrollBorder;
28 class SystemTrayItem; 31 class SystemTrayItem;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void AddScrollSeparator(); 69 void AddScrollSeparator();
67 70
68 // Removes (and destroys) all child views. 71 // Removes (and destroys) all child views.
69 void Reset(); 72 void Reset();
70 73
71 // Shows or hides the progress bar below the title row. It occupies the same 74 // Shows or hides the progress bar below the title row. It occupies the same
72 // space as the separator, so when shown the separator is hidden. If 75 // space as the separator, so when shown the separator is hidden. If
73 // |progress_bar_| doesn't already exist it will be created. 76 // |progress_bar_| doesn't already exist it will be created.
74 void ShowProgress(double value, bool visible); 77 void ShowProgress(double value, bool visible);
75 78
79 views::CustomButton* CreateSettingsButton(LoginStatus status);
bruthig 2016/11/14 04:39:11 Can you mention that the caller assumes ownership?
tdanderson 2016/11/14 19:24:59 Done.
80 views::CustomButton* CreateHelpButton(LoginStatus status);
81
82 TriView* tri_view() { return tri_view_; }
83
76 private: 84 private:
77 friend class test::TrayDetailsViewTest; 85 friend class test::TrayDetailsViewTest;
78 86
79 // Overridden to handle clicks on subclass-specific views. 87 // Overridden to handle clicks on subclass-specific views.
80 virtual void HandleViewClicked(views::View* view); 88 virtual void HandleViewClicked(views::View* view);
81 89
82 // Overridden to handle button presses on subclass-specific buttons. 90 // Overridden to handle button presses on subclass-specific buttons.
83 virtual void HandleButtonPressed(views::Button* sender, 91 virtual void HandleButtonPressed(views::Button* sender,
84 const ui::Event& event); 92 const ui::Event& event);
85 93
86 // Creates and adds subclass-specific buttons to the title row. 94 // Creates and adds subclass-specific buttons to the title row.
87 virtual void CreateExtraTitleRowButtons(); 95 virtual void CreateExtraTitleRowButtons();
88 96
89 // Transition to default view from details view. If |title_row_| has focus 97 // Transition to default view from details view. If |title_row_| has focus
90 // before transition, the default view should focus on the owner of this 98 // before transition, the default view should focus on the owner of this
91 // details view. 99 // details view.
92 void TransitionToDefaultView(); 100 void TransitionToDefaultView();
93 101
102 // Helper function which creates and returns the back button used in the
103 // material design top-most header row.
104 views::Button* CreateBackButton();
105
94 SystemTrayItem* owner_; 106 SystemTrayItem* owner_;
95 views::BoxLayout* box_layout_; 107 views::BoxLayout* box_layout_;
96 SpecialPopupRow* title_row_; 108 SpecialPopupRow* title_row_; // Not used in material design.
97 FixedSizedScrollView* scroller_; 109 FixedSizedScrollView* scroller_;
98 views::View* scroll_content_; 110 views::View* scroll_content_;
99 views::ProgressBar* progress_bar_; 111 views::ProgressBar* progress_bar_;
100 112
101 ScrollBorder* scroll_border_; // Weak reference 113 ScrollBorder* scroll_border_; // Weak reference
102 114
115 // The container view for the top-most title row in material design.
116 TriView* tri_view_;
117
118 // The label used in the top-most title row for material design.
119 views::Label* label_;
120
103 // The back button that appears in the material design title row. Not owned. 121 // The back button that appears in the material design title row. Not owned.
104 views::Button* back_button_; 122 views::Button* back_button_;
105 123
106 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); 124 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView);
107 }; 125 };
108 126
109 } // namespace ash 127 } // namespace ash
110 128
111 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ 129 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698