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

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

Issue 2373863002: mustash: Connect ash system tray "show settings" items to chrome over mojo (Closed)
Patch Set: 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 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/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // Tolerate chrome crashing and coming back up. 45 // Tolerate chrome crashing and coming back up.
46 system_tray_client_.set_connection_error_handler(base::Bind( 46 system_tray_client_.set_connection_error_handler(base::Bind(
47 &SystemTrayDelegateMus::OnClientConnectionError, base::Unretained(this))); 47 &SystemTrayDelegateMus::OnClientConnectionError, base::Unretained(this)));
48 } 48 }
49 49
50 void SystemTrayDelegateMus::OnClientConnectionError() { 50 void SystemTrayDelegateMus::OnClientConnectionError() {
51 system_tray_client_.reset(); 51 system_tray_client_.reset();
52 } 52 }
53 53
54 ////////////////////////////////////////////////////////////////////////////////
55 // SystemTrayDelegate:
56
54 base::HourClockType SystemTrayDelegateMus::GetHourClockType() const { 57 base::HourClockType SystemTrayDelegateMus::GetHourClockType() const {
55 return hour_clock_type_; 58 return hour_clock_type_;
56 } 59 }
57 60
61 void SystemTrayDelegateMus::ShowSettings() {
62 ConnectToSystemTrayClient();
msw 2016/09/27 20:14:33 optional nit: make ConnectToSystemTrayClient retur
James Cook 2016/09/27 20:48:59 Done. I kept the name ConnectToSystemTrayClient()
63 system_tray_client_->ShowSettings();
msw 2016/09/27 20:14:34 nice! looking forward to using this myself
64 }
65
58 void SystemTrayDelegateMus::ShowDateSettings() { 66 void SystemTrayDelegateMus::ShowDateSettings() {
59 ConnectToSystemTrayClient(); 67 ConnectToSystemTrayClient();
60 system_tray_client_->ShowDateSettings(); 68 system_tray_client_->ShowDateSettings();
61 } 69 }
62 70
71 void SystemTrayDelegateMus::ShowNetworkSettingsForGuid(
72 const std::string& guid) {
73 // http://crbug.com/647412
74 NOTIMPLEMENTED();
75 }
76
77 void SystemTrayDelegateMus::ShowDisplaySettings() {
78 ConnectToSystemTrayClient();
79 system_tray_client_->ShowDisplaySettings();
80 }
81
82 void SystemTrayDelegateMus::ShowPowerSettings() {
83 // http://crbug.com/647412
84 NOTIMPLEMENTED();
85 }
86
87 void SystemTrayDelegateMus::ShowChromeSlow() {
88 ConnectToSystemTrayClient();
89 system_tray_client_->ShowChromeSlow();
90 }
91
92 void SystemTrayDelegateMus::ShowIMESettings() {
93 ConnectToSystemTrayClient();
94 system_tray_client_->ShowIMESettings();
95 }
96
97 void SystemTrayDelegateMus::ShowHelp() {
98 ConnectToSystemTrayClient();
99 system_tray_client_->ShowHelp();
100 }
101
102 void SystemTrayDelegateMus::ShowAccessibilityHelp() {
103 ConnectToSystemTrayClient();
104 system_tray_client_->ShowAccessibilityHelp();
105 }
106
107 void SystemTrayDelegateMus::ShowAccessibilitySettings() {
108 ConnectToSystemTrayClient();
109 system_tray_client_->ShowAccessibilitySettings();
110 }
111
112 void SystemTrayDelegateMus::ShowPaletteHelp() {
113 ConnectToSystemTrayClient();
114 system_tray_client_->ShowPaletteHelp();
115 }
116
117 void SystemTrayDelegateMus::ShowPaletteSettings() {
118 ConnectToSystemTrayClient();
119 system_tray_client_->ShowPaletteSettings();
120 }
121
122 void SystemTrayDelegateMus::ShowPublicAccountInfo() {
123 ConnectToSystemTrayClient();
124 system_tray_client_->ShowPublicAccountInfo();
125 }
126
127 void SystemTrayDelegateMus::ShowEnterpriseInfo() {
128 // http://crbug.com/647412
129 NOTIMPLEMENTED();
130 }
131
132 void SystemTrayDelegateMus::ShowProxySettings() {
133 ConnectToSystemTrayClient();
134 system_tray_client_->ShowProxySettings();
135 }
136
137 ////////////////////////////////////////////////////////////////////////////////
138 // mojom::SystemTray:
139
63 void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) { 140 void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) {
64 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock; 141 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock;
65 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged(); 142 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged();
66 } 143 }
67 144
68 } // namespace ash 145 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698