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

Side by Side Diff: ash/system/date/date_default_view.cc

Issue 871483003: Add device policy to disallow shutdown - WebUI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits rebase Created 5 years, 11 months 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
« no previous file with comments | « ash/system/date/date_default_view.h ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/date/date_default_view.h" 5 #include "ash/system/date/date_default_view.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/date/date_view.h" 10 #include "ash/system/date/date_view.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 SystemTrayDelegate* system_tray_delegate = 95 SystemTrayDelegate* system_tray_delegate =
96 Shell::GetInstance()->system_tray_delegate(); 96 Shell::GetInstance()->system_tray_delegate();
97 if (system_tray_delegate) 97 if (system_tray_delegate)
98 system_tray_delegate->RemoveShutdownPolicyObserver(this); 98 system_tray_delegate->RemoveShutdownPolicyObserver(this);
99 } 99 }
100 100
101 views::View* DateDefaultView::GetHelpButtonView() { 101 views::View* DateDefaultView::GetHelpButtonView() {
102 return help_button_; 102 return help_button_;
103 } 103 }
104 104
105 const views::View* DateDefaultView::GetShutdownButtonViewForTest() const {
106 return shutdown_button_;
107 }
108
105 tray::DateView* DateDefaultView::GetDateView() { 109 tray::DateView* DateDefaultView::GetDateView() {
106 return date_view_; 110 return date_view_;
107 } 111 }
108 112
109 const tray::DateView* DateDefaultView::GetDateView() const { 113 const tray::DateView* DateDefaultView::GetDateView() const {
110 return date_view_; 114 return date_view_;
111 } 115 }
112 116
113 void DateDefaultView::ButtonPressed(views::Button* sender, 117 void DateDefaultView::ButtonPressed(views::Button* sender,
114 const ui::Event& event) { 118 const ui::Event& event) {
(...skipping 16 matching lines...) Expand all
131 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { 135 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
132 if (!shutdown_button_) 136 if (!shutdown_button_)
133 return; 137 return;
134 138
135 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( 139 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16(
136 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT 140 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT
137 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); 141 : IDS_ASH_STATUS_TRAY_SHUTDOWN));
138 } 142 }
139 143
140 } // namespace ash 144 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/date/date_default_view.h ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698