OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "ash/common/system/tray/special_popup_row.h" | 5 #include "ash/common/system/tray/special_popup_row.h" |
6 | 6 |
7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
9 #include "ash/common/system/tray/hover_highlight_view.h" | 9 #include "ash/common/system/tray/hover_highlight_view.h" |
10 #include "ash/common/system/tray/system_menu_button.h" | 10 #include "ash/common/system/tray/system_menu_button.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 SetLayoutManager(box_layout); | 94 SetLayoutManager(box_layout); |
95 content_ = view; | 95 content_ = view; |
96 // TODO(tdanderson): Consider moving this logic to a BoxLayout subclass. | 96 // TODO(tdanderson): Consider moving this logic to a BoxLayout subclass. |
97 AddChildViewAt(content_, views_before_content_container_ ? 1 : 0); | 97 AddChildViewAt(content_, views_before_content_container_ ? 1 : 0); |
98 if (MaterialDesignController::IsSystemTrayMenuMaterial()) | 98 if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
99 box_layout->SetFlexForView(content_, 1); | 99 box_layout->SetFlexForView(content_, 1); |
100 } | 100 } |
101 | 101 |
102 views::Button* SpecialPopupRow::AddBackButton(views::ButtonListener* listener) { | 102 views::Button* SpecialPopupRow::AddBackButton(views::ButtonListener* listener) { |
103 SystemMenuButton* button = new SystemMenuButton( | 103 SystemMenuButton* button = new SystemMenuButton( |
104 listener, kSystemMenuArrowBackIcon, IDS_ASH_STATUS_TRAY_PREVIOUS_MENU); | 104 listener, SystemMenuButton::InkDropStyle::SQUARE, |
| 105 kSystemMenuArrowBackIcon, IDS_ASH_STATUS_TRAY_PREVIOUS_MENU); |
105 AddViewBeforeContent(button); | 106 AddViewBeforeContent(button); |
106 return button; | 107 return button; |
107 } | 108 } |
108 | 109 |
109 views::CustomButton* SpecialPopupRow::AddSettingsButton( | 110 views::CustomButton* SpecialPopupRow::AddSettingsButton( |
110 views::ButtonListener* listener, | 111 views::ButtonListener* listener, |
111 LoginStatus status) { | 112 LoginStatus status) { |
112 SystemMenuButton* button = new SystemMenuButton( | 113 SystemMenuButton* button = new SystemMenuButton( |
113 listener, kSystemMenuSettingsIcon, IDS_ASH_STATUS_TRAY_SETTINGS); | 114 listener, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuSettingsIcon, |
| 115 IDS_ASH_STATUS_TRAY_SETTINGS); |
114 if (!CanOpenWebUISettings(status)) | 116 if (!CanOpenWebUISettings(status)) |
115 button->SetState(views::Button::STATE_DISABLED); | 117 button->SetState(views::Button::STATE_DISABLED); |
116 AddViewAfterContent(button); | 118 AddViewAfterContent(button); |
117 return button; | 119 return button; |
118 } | 120 } |
119 | 121 |
120 views::CustomButton* SpecialPopupRow::AddHelpButton( | 122 views::CustomButton* SpecialPopupRow::AddHelpButton( |
121 views::ButtonListener* listener, | 123 views::ButtonListener* listener, |
122 LoginStatus status) { | 124 LoginStatus status) { |
123 SystemMenuButton* button = new SystemMenuButton(listener, kSystemMenuHelpIcon, | 125 SystemMenuButton* button = |
124 IDS_ASH_STATUS_TRAY_HELP); | 126 new SystemMenuButton(listener, SystemMenuButton::InkDropStyle::SQUARE, |
| 127 kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP); |
125 if (!CanOpenWebUISettings(status)) | 128 if (!CanOpenWebUISettings(status)) |
126 button->SetState(views::Button::STATE_DISABLED); | 129 button->SetState(views::Button::STATE_DISABLED); |
127 AddViewAfterContent(button); | 130 AddViewAfterContent(button); |
128 return button; | 131 return button; |
129 } | 132 } |
130 | 133 |
131 views::ToggleButton* SpecialPopupRow::AddToggleButton( | 134 views::ToggleButton* SpecialPopupRow::AddToggleButton( |
132 views::ButtonListener* listener) { | 135 views::ButtonListener* listener) { |
133 // TODO(tdanderson): Define the focus rect for ToggleButton. | 136 // TODO(tdanderson): Define the focus rect for ToggleButton. |
134 views::ToggleButton* toggle = new views::ToggleButton(listener); | 137 views::ToggleButton* toggle = new views::ToggleButton(listener); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 287 |
285 container->SetBorder( | 288 container->SetBorder( |
286 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0)); | 289 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0)); |
287 | 290 |
288 container->SetAccessibleName( | 291 container->SetAccessibleName( |
289 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_PREVIOUS_MENU)); | 292 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_PREVIOUS_MENU)); |
290 SetContent(container); | 293 SetContent(container); |
291 } | 294 } |
292 | 295 |
293 } // namespace ash | 296 } // namespace ash |
OLD | NEW |