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 #include "ash/common/system/tiles/tiles_default_view.h" | 5 #include "ash/common/system/tiles/tiles_default_view.h" |
6 | 6 |
7 #include "ash/common/metrics/user_metrics_action.h" | 7 #include "ash/common/metrics/user_metrics_action.h" |
8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_controller.h" |
9 #include "ash/common/shutdown_controller.h" | 9 #include "ash/common/shutdown_controller.h" |
10 #include "ash/common/system/tray/system_menu_button.h" | 10 #include "ash/common/system/tray/system_menu_button.h" |
11 #include "ash/common/system/tray/system_tray.h" | 11 #include "ash/common/system/tray/system_tray.h" |
12 #include "ash/common/system/tray/system_tray_controller.h" | 12 #include "ash/common/system/tray/system_tray_controller.h" |
13 #include "ash/common/system/tray/system_tray_delegate.h" | 13 #include "ash/common/system/tray/system_tray_delegate.h" |
14 #include "ash/common/system/tray/system_tray_item.h" | 14 #include "ash/common/system/tray/system_tray_item.h" |
15 #include "ash/common/system/tray/tray_constants.h" | 15 #include "ash/common/system/tray/tray_constants.h" |
16 #include "ash/common/system/tray/tray_popup_utils.h" | 16 #include "ash/common/system/tray/tray_popup_utils.h" |
17 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
18 #include "ash/resources/vector_icons/vector_icons.h" | 18 #include "ash/resources/vector_icons/vector_icons.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 help_button_->EnableCanvasFlippingForRTLUI(false); | 82 help_button_->EnableCanvasFlippingForRTLUI(false); |
83 } | 83 } |
84 if (disable_buttons) | 84 if (disable_buttons) |
85 help_button_->SetEnabled(false); | 85 help_button_->SetEnabled(false); |
86 AddChildView(help_button_); | 86 AddChildView(help_button_); |
87 AddChildView(TrayPopupUtils::CreateVerticalSeparator()); | 87 AddChildView(TrayPopupUtils::CreateVerticalSeparator()); |
88 | 88 |
89 lock_button_ = | 89 lock_button_ = |
90 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, | 90 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, |
91 kSystemMenuLockIcon, IDS_ASH_STATUS_TRAY_LOCK); | 91 kSystemMenuLockIcon, IDS_ASH_STATUS_TRAY_LOCK); |
92 if (disable_buttons || !shell->GetSessionStateDelegate()->CanLockScreen()) | 92 if (disable_buttons || !shell->session_controller()->CanLockScreen()) |
93 lock_button_->SetEnabled(false); | 93 lock_button_->SetEnabled(false); |
94 | 94 |
95 AddChildView(lock_button_); | 95 AddChildView(lock_button_); |
96 AddChildView(TrayPopupUtils::CreateVerticalSeparator()); | 96 AddChildView(TrayPopupUtils::CreateVerticalSeparator()); |
97 | 97 |
98 power_button_ = | 98 power_button_ = |
99 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, | 99 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, |
100 kSystemMenuPowerIcon, IDS_ASH_STATUS_TRAY_SHUTDOWN); | 100 kSystemMenuPowerIcon, IDS_ASH_STATUS_TRAY_SHUTDOWN); |
101 AddChildView(power_button_); | 101 AddChildView(power_button_); |
102 // This object is recreated every time the menu opens. Don't bother updating | 102 // This object is recreated every time the menu opens. Don't bother updating |
(...skipping 29 matching lines...) Expand all Loading... |
132 views::View* TilesDefaultView::GetHelpButtonView() const { | 132 views::View* TilesDefaultView::GetHelpButtonView() const { |
133 return help_button_; | 133 return help_button_; |
134 } | 134 } |
135 | 135 |
136 const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest() | 136 const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest() |
137 const { | 137 const { |
138 return power_button_; | 138 return power_button_; |
139 } | 139 } |
140 | 140 |
141 } // namespace ash | 141 } // namespace ash |
OLD | NEW |