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

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

Issue 2381753002: Use mojo SystemTray interfaces for both mash and classic ash (Closed)
Patch Set: cleanup Created 4 years, 2 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/common/system/date/tray_date.h" 5 #include "ash/common/system/date/tray_date.h"
6 6
7 #include "ash/common/shelf/wm_shelf_util.h" 7 #include "ash/common/shelf/wm_shelf_util.h"
8 #include "ash/common/system/date/date_default_view.h" 8 #include "ash/common/system/date/date_default_view.h"
9 #include "ash/common/system/date/date_view.h" 9 #include "ash/common/system/date/date_view.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
11 #include "ash/common/system/tray/system_tray_notifier.h" 11 #include "ash/common/system/tray/system_tray_controller.h"
12 #include "ash/common/system/tray/tray_item_view.h" 12 #include "ash/common/system/tray/tray_item_view.h"
13 #include "ash/common/wm_shell.h" 13 #include "ash/common/wm_shell.h"
14 14
15 #if defined(OS_CHROMEOS) 15 #if defined(OS_CHROMEOS)
16 #include "ash/common/system/chromeos/system_clock_observer.h" 16 #include "ash/common/system/chromeos/system_clock_observer.h"
17 #endif 17 #endif
18 18
19 namespace ash { 19 namespace ash {
20 20
21 TrayDate::TrayDate(SystemTray* system_tray) 21 TrayDate::TrayDate(SystemTray* system_tray)
22 : SystemTrayItem(system_tray, UMA_DATE), 22 : SystemTrayItem(system_tray, UMA_DATE),
23 time_tray_(NULL), 23 time_tray_(NULL),
24 default_view_(NULL), 24 default_view_(NULL),
25 login_status_(LoginStatus::NOT_LOGGED_IN) { 25 login_status_(LoginStatus::NOT_LOGGED_IN) {
26 #if defined(OS_CHROMEOS) 26 #if defined(OS_CHROMEOS)
27 system_clock_observer_.reset(new SystemClockObserver()); 27 system_clock_observer_.reset(new SystemClockObserver());
28 #endif 28 #endif
29 WmShell::Get()->system_tray_notifier()->AddClockObserver(this); 29 WmShell::Get()->system_tray_controller()->AddClockObserver(this);
30 } 30 }
31 31
32 TrayDate::~TrayDate() { 32 TrayDate::~TrayDate() {
33 WmShell::Get()->system_tray_notifier()->RemoveClockObserver(this); 33 WmShell::Get()->system_tray_controller()->RemoveClockObserver(this);
34 } 34 }
35 35
36 views::View* TrayDate::GetHelpButtonView() const { 36 views::View* TrayDate::GetHelpButtonView() const {
37 if (!default_view_) 37 if (!default_view_)
38 return NULL; 38 return NULL;
39 return default_view_->GetHelpButtonView(); 39 return default_view_->GetHelpButtonView();
40 } 40 }
41 41
42 const tray::TimeView* TrayDate::GetTimeTrayForTesting() const { 42 const tray::TimeView* TrayDate::GetTimeTrayForTesting() const {
43 return time_tray_; 43 return time_tray_;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); 121 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE);
122 } 122 }
123 } 123 }
124 124
125 void TrayDate::Refresh() { 125 void TrayDate::Refresh() {
126 if (time_tray_) 126 if (time_tray_)
127 time_tray_->UpdateText(); 127 time_tray_->UpdateText();
128 } 128 }
129 129
130 } // namespace ash 130 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698