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

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

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. Created 7 years, 8 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
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 #include "ash/system/date/tray_date.h" 5 #include "ash/system/date/tray_date.h"
6 6
7 #include "ash/session_state_delegate.h"
7 #include "ash/shell.h" 8 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
9 #include "ash/system/date/date_view.h" 10 #include "ash/system/date/date_view.h"
10 #include "ash/system/tray/system_tray.h" 11 #include "ash/system/tray/system_tray.h"
11 #include "ash/system/tray/system_tray_delegate.h" 12 #include "ash/system/tray/system_tray_delegate.h"
12 #include "ash/system/tray/system_tray_notifier.h" 13 #include "ash/system/tray/system_tray_notifier.h"
13 #include "ash/system/tray/tray_constants.h" 14 #include "ash/system/tray/tray_constants.h"
14 #include "ash/system/tray/tray_item_view.h" 15 #include "ash/system/tray/tray_item_view.h"
15 #include "ash/system/tray/tray_popup_header_button.h" 16 #include "ash/system/tray/tray_popup_header_button.h"
16 #include "base/i18n/time_formatting.h" 17 #include "base/i18n/time_formatting.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 IDR_AURA_UBER_TRAY_SHUTDOWN, 83 IDR_AURA_UBER_TRAY_SHUTDOWN,
83 IDR_AURA_UBER_TRAY_SHUTDOWN, 84 IDR_AURA_UBER_TRAY_SHUTDOWN,
84 IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER, 85 IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER,
85 IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER, 86 IDR_AURA_UBER_TRAY_SHUTDOWN_HOVER,
86 IDS_ASH_STATUS_TRAY_SHUTDOWN); 87 IDS_ASH_STATUS_TRAY_SHUTDOWN);
87 shutdown_->SetTooltipText( 88 shutdown_->SetTooltipText(
88 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN)); 89 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHUTDOWN));
89 view->AddButton(shutdown_); 90 view->AddButton(shutdown_);
90 } 91 }
91 92
92 if (ash::Shell::GetInstance()->CanLockScreen()) { 93 if (ash::Shell::GetInstance()->session_state_delegate()->CanLockScreen()) {
93 lock_ = new ash::internal::TrayPopupHeaderButton(this, 94 lock_ = new ash::internal::TrayPopupHeaderButton(this,
94 IDR_AURA_UBER_TRAY_LOCKSCREEN, 95 IDR_AURA_UBER_TRAY_LOCKSCREEN,
95 IDR_AURA_UBER_TRAY_LOCKSCREEN, 96 IDR_AURA_UBER_TRAY_LOCKSCREEN,
96 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER, 97 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER,
97 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER, 98 IDR_AURA_UBER_TRAY_LOCKSCREEN_HOVER,
98 IDS_ASH_STATUS_TRAY_LOCK); 99 IDS_ASH_STATUS_TRAY_LOCK);
99 lock_->SetTooltipText( 100 lock_->SetTooltipText(
100 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCK)); 101 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCK));
101 view->AddButton(lock_); 102 view->AddButton(lock_);
102 } 103 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 time_tray_->UpdateTimeFormat(); 200 time_tray_->UpdateTimeFormat();
200 } 201 }
201 202
202 void TrayDate::Refresh() { 203 void TrayDate::Refresh() {
203 if (time_tray_) 204 if (time_tray_)
204 time_tray_->UpdateText(); 205 time_tray_->UpdateText();
205 } 206 }
206 207
207 } // namespace internal 208 } // namespace internal
208 } // namespace ash 209 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698