OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/ash/system_tray_delegate_linux.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_linux.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 registrar_->Add(this, | 38 registrar_->Add(this, |
39 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, | 39 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
40 content::NotificationService::AllSources()); | 40 content::NotificationService::AllSources()); |
41 } | 41 } |
42 | 42 |
43 virtual ~SystemTrayDelegateLinux() { | 43 virtual ~SystemTrayDelegateLinux() { |
44 registrar_.reset(); | 44 registrar_.reset(); |
45 } | 45 } |
46 | 46 |
47 // Overridden from ash::SystemTrayDelegate: | 47 // Overridden from ash::SystemTrayDelegate: |
48 virtual void Initialize() OVERRIDE { | 48 virtual void Initialize() override { |
49 UpdateClockType(); | 49 UpdateClockType(); |
50 } | 50 } |
51 | 51 |
52 virtual void Shutdown() OVERRIDE { | 52 virtual void Shutdown() override { |
53 } | 53 } |
54 | 54 |
55 virtual bool GetTrayVisibilityOnStartup() OVERRIDE { | 55 virtual bool GetTrayVisibilityOnStartup() override { |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
59 virtual ash::user::LoginStatus GetUserLoginStatus() const OVERRIDE { | 59 virtual ash::user::LoginStatus GetUserLoginStatus() const override { |
60 return ash::user::LOGGED_IN_OWNER; | 60 return ash::user::LOGGED_IN_OWNER; |
61 } | 61 } |
62 | 62 |
63 virtual void ChangeProfilePicture() OVERRIDE { | 63 virtual void ChangeProfilePicture() override { |
64 } | 64 } |
65 | 65 |
66 virtual const std::string GetEnterpriseDomain() const OVERRIDE { | 66 virtual const std::string GetEnterpriseDomain() const override { |
67 return std::string(); | 67 return std::string(); |
68 } | 68 } |
69 | 69 |
70 virtual const base::string16 GetEnterpriseMessage() const OVERRIDE { | 70 virtual const base::string16 GetEnterpriseMessage() const override { |
71 return base::string16(); | 71 return base::string16(); |
72 } | 72 } |
73 | 73 |
74 virtual const std::string GetSupervisedUserManager() const OVERRIDE { | 74 virtual const std::string GetSupervisedUserManager() const override { |
75 return std::string(); | 75 return std::string(); |
76 } | 76 } |
77 | 77 |
78 virtual const base::string16 GetSupervisedUserManagerName() const OVERRIDE { | 78 virtual const base::string16 GetSupervisedUserManagerName() const override { |
79 return base::string16(); | 79 return base::string16(); |
80 } | 80 } |
81 | 81 |
82 virtual const base::string16 GetSupervisedUserMessage() const OVERRIDE { | 82 virtual const base::string16 GetSupervisedUserMessage() const override { |
83 return base::string16(); | 83 return base::string16(); |
84 } | 84 } |
85 | 85 |
86 virtual bool IsUserSupervised() const OVERRIDE { | 86 virtual bool IsUserSupervised() const override { |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 virtual bool SystemShouldUpgrade() const OVERRIDE { | 90 virtual bool SystemShouldUpgrade() const override { |
91 return UpgradeDetector::GetInstance()->notify_upgrade(); | 91 return UpgradeDetector::GetInstance()->notify_upgrade(); |
92 } | 92 } |
93 | 93 |
94 virtual base::HourClockType GetHourClockType() const OVERRIDE { | 94 virtual base::HourClockType GetHourClockType() const override { |
95 return clock_type_; | 95 return clock_type_; |
96 } | 96 } |
97 | 97 |
98 virtual void ShowSettings() OVERRIDE { | 98 virtual void ShowSettings() override { |
99 } | 99 } |
100 | 100 |
101 virtual bool ShouldShowSettings() OVERRIDE { | 101 virtual bool ShouldShowSettings() override { |
102 return true; | 102 return true; |
103 } | 103 } |
104 | 104 |
105 virtual void ShowDateSettings() OVERRIDE { | 105 virtual void ShowDateSettings() override { |
106 } | 106 } |
107 | 107 |
108 virtual void ShowSetTimeDialog() OVERRIDE { | 108 virtual void ShowSetTimeDialog() override { |
109 } | 109 } |
110 | 110 |
111 virtual void ShowNetworkSettings(const std::string& service_path) OVERRIDE { | 111 virtual void ShowNetworkSettings(const std::string& service_path) override { |
112 } | 112 } |
113 | 113 |
114 virtual void ShowBluetoothSettings() OVERRIDE { | 114 virtual void ShowBluetoothSettings() override { |
115 } | 115 } |
116 | 116 |
117 virtual void ShowDisplaySettings() OVERRIDE { | 117 virtual void ShowDisplaySettings() override { |
118 } | 118 } |
119 | 119 |
120 virtual void ShowChromeSlow() OVERRIDE { | 120 virtual void ShowChromeSlow() override { |
121 chrome::ScopedTabbedBrowserDisplayer displayer( | 121 chrome::ScopedTabbedBrowserDisplayer displayer( |
122 ProfileManager::GetPrimaryUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 122 ProfileManager::GetPrimaryUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); |
123 chrome::ShowSlow(displayer.browser()); | 123 chrome::ShowSlow(displayer.browser()); |
124 } | 124 } |
125 | 125 |
126 virtual bool ShouldShowDisplayNotification() OVERRIDE { | 126 virtual bool ShouldShowDisplayNotification() override { |
127 return false; | 127 return false; |
128 } | 128 } |
129 | 129 |
130 virtual void ShowIMESettings() OVERRIDE { | 130 virtual void ShowIMESettings() override { |
131 } | 131 } |
132 | 132 |
133 virtual void ShowHelp() OVERRIDE { | 133 virtual void ShowHelp() override { |
134 chrome::ShowHelpForProfile( | 134 chrome::ShowHelpForProfile( |
135 ProfileManager::GetLastUsedProfile(), | 135 ProfileManager::GetLastUsedProfile(), |
136 chrome::HOST_DESKTOP_TYPE_ASH, | 136 chrome::HOST_DESKTOP_TYPE_ASH, |
137 chrome::HELP_SOURCE_MENU); | 137 chrome::HELP_SOURCE_MENU); |
138 } | 138 } |
139 | 139 |
140 virtual void ShowAccessibilityHelp() OVERRIDE { | 140 virtual void ShowAccessibilityHelp() override { |
141 } | 141 } |
142 | 142 |
143 virtual void ShowAccessibilitySettings() OVERRIDE { | 143 virtual void ShowAccessibilitySettings() override { |
144 } | 144 } |
145 | 145 |
146 virtual void ShowPublicAccountInfo() OVERRIDE { | 146 virtual void ShowPublicAccountInfo() override { |
147 } | 147 } |
148 | 148 |
149 virtual void ShowSupervisedUserInfo() OVERRIDE { | 149 virtual void ShowSupervisedUserInfo() override { |
150 } | 150 } |
151 | 151 |
152 virtual void ShowEnterpriseInfo() OVERRIDE { | 152 virtual void ShowEnterpriseInfo() override { |
153 } | 153 } |
154 | 154 |
155 virtual void ShowUserLogin() OVERRIDE { | 155 virtual void ShowUserLogin() override { |
156 } | 156 } |
157 | 157 |
158 virtual bool ShowSpringChargerReplacementDialog() OVERRIDE { | 158 virtual bool ShowSpringChargerReplacementDialog() override { |
159 return false; | 159 return false; |
160 } | 160 } |
161 | 161 |
162 virtual bool IsSpringChargerReplacementDialogVisible() OVERRIDE { | 162 virtual bool IsSpringChargerReplacementDialogVisible() override { |
163 return false; | 163 return false; |
164 } | 164 } |
165 | 165 |
166 virtual bool HasUserConfirmedSafeSpringCharger() OVERRIDE { | 166 virtual bool HasUserConfirmedSafeSpringCharger() override { |
167 return false; | 167 return false; |
168 } | 168 } |
169 | 169 |
170 virtual void ShutDown() OVERRIDE { | 170 virtual void ShutDown() override { |
171 } | 171 } |
172 | 172 |
173 virtual void SignOut() OVERRIDE { | 173 virtual void SignOut() override { |
174 } | 174 } |
175 | 175 |
176 virtual void RequestLockScreen() OVERRIDE { | 176 virtual void RequestLockScreen() override { |
177 } | 177 } |
178 | 178 |
179 virtual void RequestRestartForUpdate() OVERRIDE { | 179 virtual void RequestRestartForUpdate() override { |
180 chrome::AttemptRestart(); | 180 chrome::AttemptRestart(); |
181 } | 181 } |
182 | 182 |
183 virtual void GetAvailableBluetoothDevices( | 183 virtual void GetAvailableBluetoothDevices( |
184 ash::BluetoothDeviceList* list) OVERRIDE { | 184 ash::BluetoothDeviceList* list) override { |
185 } | 185 } |
186 | 186 |
187 virtual void BluetoothStartDiscovering() OVERRIDE { | 187 virtual void BluetoothStartDiscovering() override { |
188 } | 188 } |
189 | 189 |
190 virtual void BluetoothStopDiscovering() OVERRIDE { | 190 virtual void BluetoothStopDiscovering() override { |
191 } | 191 } |
192 | 192 |
193 virtual void ConnectToBluetoothDevice(const std::string& address) OVERRIDE { | 193 virtual void ConnectToBluetoothDevice(const std::string& address) override { |
194 } | 194 } |
195 | 195 |
196 virtual bool IsBluetoothDiscovering() OVERRIDE { | 196 virtual bool IsBluetoothDiscovering() override { |
197 return false; | 197 return false; |
198 } | 198 } |
199 | 199 |
200 virtual void GetCurrentIME(ash::IMEInfo* info) OVERRIDE { | 200 virtual void GetCurrentIME(ash::IMEInfo* info) override { |
201 } | 201 } |
202 | 202 |
203 virtual void GetAvailableIMEList(ash::IMEInfoList* list) OVERRIDE { | 203 virtual void GetAvailableIMEList(ash::IMEInfoList* list) override { |
204 } | 204 } |
205 | 205 |
206 virtual void GetCurrentIMEProperties( | 206 virtual void GetCurrentIMEProperties( |
207 ash::IMEPropertyInfoList* list) OVERRIDE { | 207 ash::IMEPropertyInfoList* list) override { |
208 } | 208 } |
209 | 209 |
210 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { | 210 virtual void SwitchIME(const std::string& ime_id) override { |
211 } | 211 } |
212 | 212 |
213 virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { | 213 virtual void ActivateIMEProperty(const std::string& key) override { |
214 } | 214 } |
215 | 215 |
216 virtual void ShowNetworkConfigure(const std::string& network_id) OVERRIDE { | 216 virtual void ShowNetworkConfigure(const std::string& network_id) override { |
217 } | 217 } |
218 | 218 |
219 virtual bool EnrollNetwork(const std::string& network_id) OVERRIDE { | 219 virtual bool EnrollNetwork(const std::string& network_id) override { |
220 return true; | 220 return true; |
221 } | 221 } |
222 | 222 |
223 virtual void ManageBluetoothDevices() OVERRIDE { | 223 virtual void ManageBluetoothDevices() override { |
224 } | 224 } |
225 | 225 |
226 virtual void ToggleBluetooth() OVERRIDE { | 226 virtual void ToggleBluetooth() override { |
227 } | 227 } |
228 | 228 |
229 virtual void ShowMobileSimDialog() OVERRIDE { | 229 virtual void ShowMobileSimDialog() override { |
230 } | 230 } |
231 | 231 |
232 virtual void ShowMobileSetupDialog(const std::string& service_path) OVERRIDE { | 232 virtual void ShowMobileSetupDialog(const std::string& service_path) override { |
233 } | 233 } |
234 | 234 |
235 virtual void ShowOtherNetworkDialog(const std::string& type) OVERRIDE { | 235 virtual void ShowOtherNetworkDialog(const std::string& type) override { |
236 } | 236 } |
237 | 237 |
238 virtual bool GetBluetoothAvailable() OVERRIDE { | 238 virtual bool GetBluetoothAvailable() override { |
239 return false; | 239 return false; |
240 } | 240 } |
241 | 241 |
242 virtual bool GetBluetoothEnabled() OVERRIDE { | 242 virtual bool GetBluetoothEnabled() override { |
243 return false; | 243 return false; |
244 } | 244 } |
245 | 245 |
246 virtual bool GetBluetoothDiscovering() OVERRIDE { | 246 virtual bool GetBluetoothDiscovering() override { |
247 return false; | 247 return false; |
248 } | 248 } |
249 | 249 |
250 virtual void ChangeProxySettings() OVERRIDE { | 250 virtual void ChangeProxySettings() override { |
251 } | 251 } |
252 | 252 |
253 virtual ash::VolumeControlDelegate* | 253 virtual ash::VolumeControlDelegate* |
254 GetVolumeControlDelegate() const OVERRIDE { | 254 GetVolumeControlDelegate() const override { |
255 return NULL; | 255 return NULL; |
256 } | 256 } |
257 | 257 |
258 virtual void SetVolumeControlDelegate( | 258 virtual void SetVolumeControlDelegate( |
259 scoped_ptr<ash::VolumeControlDelegate> delegate) OVERRIDE { | 259 scoped_ptr<ash::VolumeControlDelegate> delegate) override { |
260 } | 260 } |
261 | 261 |
262 virtual bool GetSessionStartTime( | 262 virtual bool GetSessionStartTime( |
263 base::TimeTicks* session_start_time) OVERRIDE { | 263 base::TimeTicks* session_start_time) override { |
264 return false; | 264 return false; |
265 } | 265 } |
266 | 266 |
267 virtual bool GetSessionLengthLimit( | 267 virtual bool GetSessionLengthLimit( |
268 base::TimeDelta* session_length_limit) OVERRIDE { | 268 base::TimeDelta* session_length_limit) override { |
269 return false; | 269 return false; |
270 } | 270 } |
271 | 271 |
272 virtual int GetSystemTrayMenuWidth() OVERRIDE { | 272 virtual int GetSystemTrayMenuWidth() override { |
273 return l10n_util::GetLocalizedContentsWidthInPixels( | 273 return l10n_util::GetLocalizedContentsWidthInPixels( |
274 IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS); | 274 IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS); |
275 } | 275 } |
276 | 276 |
277 virtual void ActiveUserWasChanged() OVERRIDE { | 277 virtual void ActiveUserWasChanged() override { |
278 } | 278 } |
279 | 279 |
280 virtual bool IsSearchKeyMappedToCapsLock() OVERRIDE { | 280 virtual bool IsSearchKeyMappedToCapsLock() override { |
281 return false; | 281 return false; |
282 } | 282 } |
283 | 283 |
284 virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( | 284 virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( |
285 const std::string& user_id) OVERRIDE { | 285 const std::string& user_id) override { |
286 return NULL; | 286 return NULL; |
287 } | 287 } |
288 | 288 |
289 private: | 289 private: |
290 ash::SystemTrayNotifier* GetSystemTrayNotifier() { | 290 ash::SystemTrayNotifier* GetSystemTrayNotifier() { |
291 return ash::Shell::GetInstance()->system_tray_notifier(); | 291 return ash::Shell::GetInstance()->system_tray_notifier(); |
292 } | 292 } |
293 | 293 |
294 void UpdateClockType() { | 294 void UpdateClockType() { |
295 clock_type_ = (base::GetHourClockType() == base::k24HourClock) ? | 295 clock_type_ = (base::GetHourClockType() == base::k24HourClock) ? |
296 base::k24HourClock : base::k12HourClock; | 296 base::k24HourClock : base::k12HourClock; |
297 GetSystemTrayNotifier()->NotifyDateFormatChanged(); | 297 GetSystemTrayNotifier()->NotifyDateFormatChanged(); |
298 } | 298 } |
299 | 299 |
300 // content::NotificationObserver implementation. | 300 // content::NotificationObserver implementation. |
301 virtual void Observe(int type, | 301 virtual void Observe(int type, |
302 const content::NotificationSource& source, | 302 const content::NotificationSource& source, |
303 const content::NotificationDetails& details) OVERRIDE { | 303 const content::NotificationDetails& details) override { |
304 if (type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED) { | 304 if (type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED) { |
305 UpgradeDetector* detector = | 305 UpgradeDetector* detector = |
306 content::Source<UpgradeDetector>(source).ptr(); | 306 content::Source<UpgradeDetector>(source).ptr(); |
307 ash::UpdateObserver::UpdateSeverity severity = | 307 ash::UpdateObserver::UpdateSeverity severity = |
308 ash::UpdateObserver::UPDATE_NORMAL; | 308 ash::UpdateObserver::UPDATE_NORMAL; |
309 switch (detector->upgrade_notification_stage()) { | 309 switch (detector->upgrade_notification_stage()) { |
310 case UpgradeDetector::UPGRADE_ANNOYANCE_CRITICAL: | 310 case UpgradeDetector::UPGRADE_ANNOYANCE_CRITICAL: |
311 case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE: | 311 case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE: |
312 severity = ash::UpdateObserver::UPDATE_SEVERE_RED; | 312 severity = ash::UpdateObserver::UPDATE_SEVERE_RED; |
313 break; | 313 break; |
(...skipping 19 matching lines...) Expand all Loading... |
333 | 333 |
334 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateLinux); | 334 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateLinux); |
335 }; | 335 }; |
336 | 336 |
337 } // namespace | 337 } // namespace |
338 | 338 |
339 | 339 |
340 ash::SystemTrayDelegate* CreateLinuxSystemTrayDelegate() { | 340 ash::SystemTrayDelegate* CreateLinuxSystemTrayDelegate() { |
341 return new SystemTrayDelegateLinux(); | 341 return new SystemTrayDelegateLinux(); |
342 } | 342 } |
OLD | NEW |