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

Side by Side Diff: ash/mus/system_tray_delegate_mus.cc

Issue 2360143004: mash: Add SystemTrayClient interface, use to show date settings (Closed)
Patch Set: tweaks, similarity 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mus/system_tray_delegate_mus.h" 5 #include "ash/mus/system_tray_delegate_mus.h"
6 6
7 #include "ash/common/system/tray/system_tray_notifier.h" 7 #include "ash/common/system/tray/system_tray_notifier.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 18 matching lines...) Expand all
29 29
30 // static 30 // static
31 SystemTrayDelegateMus* SystemTrayDelegateMus::Get() { 31 SystemTrayDelegateMus* SystemTrayDelegateMus::Get() {
32 return g_instance; 32 return g_instance;
33 } 33 }
34 34
35 base::HourClockType SystemTrayDelegateMus::GetHourClockType() const { 35 base::HourClockType SystemTrayDelegateMus::GetHourClockType() const {
36 return hour_clock_type_; 36 return hour_clock_type_;
37 } 37 }
38 38
39 void SystemTrayDelegateMus::ShowDateSettings() {
40 system_tray_client_->ShowDateSettings();
James Cook 2016/09/22 23:19:18 Is there a naming convention for these interfacept
sky 2016/09/23 16:42:26 How do you know SetClient() has been called by the
sky 2016/09/23 16:42:26 'client_' is actually used a fair amount. And no,
41 }
42
43 void SystemTrayDelegateMus::SetClient(
44 mojom::SystemTrayClientPtr system_tray_client) {
45 DCHECK(system_tray_client);
46 DCHECK(!system_tray_client_);
47 system_tray_client_ = std::move(system_tray_client);
48 // No special client connection error handling.
James Cook 2016/09/22 23:19:18 Not sure if I need set_connection_error_handler()
sky 2016/09/23 16:42:25 It's only necessary if you want to take action if
49 }
50
39 void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) { 51 void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) {
40 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock; 52 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock;
41 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged(); 53 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged();
42 } 54 }
43 55
44 } // namespace ash 56 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698