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

Side by Side Diff: ash/common/system/chromeos/system_clock_observer.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/chromeos/system_clock_observer.h" 5 #include "ash/common/system/chromeos/system_clock_observer.h"
6 6
7 #include "ash/common/dbus_thread_manager_ash.h"
7 #include "ash/common/system/tray/system_tray_notifier.h" 8 #include "ash/common/system/tray/system_tray_notifier.h"
8 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 10 // #include "chromeos/dbus/dbus_thread_manager.h"
11 #include "chromeos/dbus/system_clock_client.h"
10 12
11 namespace ash { 13 namespace ash {
12 14
13 SystemClockObserver::SystemClockObserver() { 15 SystemClockObserver::SystemClockObserver() {
14 chromeos::DBusThreadManager::Get()->GetSystemClockClient()->AddObserver(this); 16 DBusThreadManagerAsh::Get()->GetSystemClockClient()->AddObserver(this);
15 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this); 17 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this);
16 can_set_time_ = 18 can_set_time_ =
17 chromeos::DBusThreadManager::Get()->GetSystemClockClient()->CanSetTime(); 19 DBusThreadManagerAsh::Get()->GetSystemClockClient()->CanSetTime();
18 } 20 }
19 21
20 SystemClockObserver::~SystemClockObserver() { 22 SystemClockObserver::~SystemClockObserver() {
21 chromeos::DBusThreadManager::Get()->GetSystemClockClient()->RemoveObserver( 23 DBusThreadManagerAsh::Get()->GetSystemClockClient()->RemoveObserver(this);
22 this);
23 chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this); 24 chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this);
24 } 25 }
25 26
26 void SystemClockObserver::SystemClockUpdated() { 27 void SystemClockObserver::SystemClockUpdated() {
27 WmShell::Get()->system_tray_notifier()->NotifySystemClockTimeUpdated(); 28 WmShell::Get()->system_tray_notifier()->NotifySystemClockTimeUpdated();
28 } 29 }
29 30
30 void SystemClockObserver::SystemClockCanSetTimeChanged(bool can_set_time) { 31 void SystemClockObserver::SystemClockCanSetTimeChanged(bool can_set_time) {
31 can_set_time_ = can_set_time; 32 can_set_time_ = can_set_time;
32 WmShell::Get()->system_tray_notifier()->NotifySystemClockCanSetTimeChanged( 33 WmShell::Get()->system_tray_notifier()->NotifySystemClockCanSetTimeChanged(
33 can_set_time_); 34 can_set_time_);
34 } 35 }
35 36
36 void SystemClockObserver::TimezoneChanged(const icu::TimeZone& timezone) { 37 void SystemClockObserver::TimezoneChanged(const icu::TimeZone& timezone) {
37 WmShell::Get()->system_tray_notifier()->NotifyRefreshClock(); 38 WmShell::Get()->system_tray_notifier()->NotifyRefreshClock();
38 } 39 }
39 40
40 } // namespace ash 41 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/power/power_status.cc ('k') | ash/common/system/date/date_default_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698