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

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

Issue 2061123004: mash: Move //ash/system/date to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uma
Patch Set: rebase again Created 4 years, 6 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/chromeos/system_clock_observer.h ('k') | ash/system/date/date_default_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/system/chromeos/system_clock_observer.h"
6
7 #include "ash/common/system/tray/wm_system_tray_notifier.h"
8 #include "ash/common/wm_shell.h"
9 #include "chromeos/dbus/dbus_thread_manager.h"
10
11 namespace ash {
12
13 SystemClockObserver::SystemClockObserver() {
14 chromeos::DBusThreadManager::Get()->GetSystemClockClient()
15 ->AddObserver(this);
16 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this);
17 can_set_time_ =
18 chromeos::DBusThreadManager::Get()->GetSystemClockClient()->CanSetTime();
19 }
20
21 SystemClockObserver::~SystemClockObserver() {
22 chromeos::DBusThreadManager::Get()->GetSystemClockClient()
23 ->RemoveObserver(this);
24 chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this);
25 }
26
27 void SystemClockObserver::SystemClockUpdated() {
28 WmShell::Get()->system_tray_notifier()->NotifySystemClockTimeUpdated();
29 }
30
31 void SystemClockObserver::SystemClockCanSetTimeChanged(bool can_set_time) {
32 can_set_time_ = can_set_time;
33 WmShell::Get()->system_tray_notifier()->NotifySystemClockCanSetTimeChanged(
34 can_set_time_);
35 }
36
37 void SystemClockObserver::TimezoneChanged(const icu::TimeZone& timezone) {
38 WmShell::Get()->system_tray_notifier()->NotifyRefreshClock();
39 }
40
41 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/system_clock_observer.h ('k') | ash/system/date/date_default_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698