OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
10 #include "ash/system/bluetooth/bluetooth_observer.h" | |
10 #include "ash/system/brightness/brightness_observer.h" | 11 #include "ash/system/brightness/brightness_observer.h" |
11 #include "ash/system/ime/ime_observer.h" | 12 #include "ash/system/ime/ime_observer.h" |
12 #include "ash/system/network/network_observer.h" | 13 #include "ash/system/network/network_observer.h" |
13 #include "ash/system/power/clock_observer.h" | 14 #include "ash/system/power/clock_observer.h" |
14 #include "ash/system/power/power_status_observer.h" | 15 #include "ash/system/power/power_status_observer.h" |
15 #include "ash/system/tray/system_tray.h" | 16 #include "ash/system/tray/system_tray.h" |
16 #include "ash/system/tray/system_tray_delegate.h" | 17 #include "ash/system/tray/system_tray_delegate.h" |
17 #include "ash/system/tray_accessibility.h" | 18 #include "ash/system/tray_accessibility.h" |
18 #include "ash/system/tray_caps_lock.h" | 19 #include "ash/system/tray_caps_lock.h" |
19 #include "ash/system/user/update_observer.h" | 20 #include "ash/system/user/update_observer.h" |
20 #include "ash/system/user/user_observer.h" | 21 #include "ash/system/user/user_observer.h" |
21 #include "base/logging.h" | 22 #include "base/logging.h" |
22 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
23 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/chromeos/audio/audio_handler.h" | 25 #include "chrome/browser/chromeos/audio/audio_handler.h" |
26 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" | |
27 #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" | |
25 #include "chrome/browser/chromeos/cros/cros_library.h" | 28 #include "chrome/browser/chromeos/cros/cros_library.h" |
26 #include "chrome/browser/chromeos/cros/network_library.h" | 29 #include "chrome/browser/chromeos/cros/network_library.h" |
27 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 30 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
28 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 31 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 32 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
30 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 33 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
31 #include "chrome/browser/chromeos/input_method/input_method_whitelist.h" | 34 #include "chrome/browser/chromeos/input_method/input_method_whitelist.h" |
32 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 35 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
33 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 36 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
34 #include "chrome/browser/chromeos/login/login_display_host.h" | 37 #include "chrome/browser/chromeos/login/login_display_host.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
58 NetworkMenuIcon* network_icon, | 61 NetworkMenuIcon* network_icon, |
59 NetworkMenu* network_menu) { | 62 NetworkMenu* network_menu) { |
60 ash::NetworkIconInfo info; | 63 ash::NetworkIconInfo info; |
61 info.name = UTF8ToUTF16(network->name()); | 64 info.name = UTF8ToUTF16(network->name()); |
62 info.image = network_icon->GetBitmap(network, NetworkMenuIcon::SIZE_SMALL); | 65 info.image = network_icon->GetBitmap(network, NetworkMenuIcon::SIZE_SMALL); |
63 info.service_path = network->service_path(); | 66 info.service_path = network->service_path(); |
64 info.highlight = network_menu->ShouldHighlightNetwork(network); | 67 info.highlight = network_menu->ShouldHighlightNetwork(network); |
65 return info; | 68 return info; |
66 } | 69 } |
67 | 70 |
71 void BluetoothPowerFailure() { | |
sadrul
2012/03/21 05:41:31
Is it necessary to do anything here?
keybuk
2012/03/21 14:58:57
you should probably present an error to the user t
sadrul
2012/03/21 15:52:34
I have added a TODO here. I will discuss with the
| |
72 } | |
73 | |
68 class SystemTrayDelegate : public ash::SystemTrayDelegate, | 74 class SystemTrayDelegate : public ash::SystemTrayDelegate, |
69 public AudioHandler::VolumeObserver, | 75 public AudioHandler::VolumeObserver, |
70 public PowerManagerClient::Observer, | 76 public PowerManagerClient::Observer, |
71 public NetworkMenuIcon::Delegate, | 77 public NetworkMenuIcon::Delegate, |
72 public NetworkMenu::Delegate, | 78 public NetworkMenu::Delegate, |
73 public NetworkLibrary::NetworkManagerObserver, | 79 public NetworkLibrary::NetworkManagerObserver, |
74 public NetworkLibrary::NetworkObserver, | 80 public NetworkLibrary::NetworkObserver, |
75 public NetworkLibrary::CellularDataPlanObserver, | 81 public NetworkLibrary::CellularDataPlanObserver, |
76 public content::NotificationObserver, | 82 public content::NotificationObserver, |
77 public input_method::InputMethodManager::Observer, | 83 public input_method::InputMethodManager::Observer, |
78 public system::TimezoneSettings::Observer, | 84 public system::TimezoneSettings::Observer, |
85 public BluetoothAdapter::Observer, | |
79 public SystemKeyEventListener::CapsLockObserver { | 86 public SystemKeyEventListener::CapsLockObserver { |
80 public: | 87 public: |
81 explicit SystemTrayDelegate(ash::SystemTray* tray) | 88 explicit SystemTrayDelegate(ash::SystemTray* tray) |
82 : tray_(tray), | 89 : tray_(tray), |
83 network_icon_(ALLOW_THIS_IN_INITIALIZER_LIST( | 90 network_icon_(ALLOW_THIS_IN_INITIALIZER_LIST( |
84 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), | 91 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), |
85 network_icon_large_(ALLOW_THIS_IN_INITIALIZER_LIST( | 92 network_icon_large_(ALLOW_THIS_IN_INITIALIZER_LIST( |
86 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), | 93 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), |
87 network_menu_(ALLOW_THIS_IN_INITIALIZER_LIST(new NetworkMenu(this))), | 94 network_menu_(ALLOW_THIS_IN_INITIALIZER_LIST(new NetworkMenu(this))), |
88 clock_type_(base::k24HourClock) { | 95 clock_type_(base::k24HourClock) { |
(...skipping 26 matching lines...) Expand all Loading... | |
115 registrar_.Add(this, | 122 registrar_.Add(this, |
116 chrome::NOTIFICATION_SESSION_STARTED, | 123 chrome::NOTIFICATION_SESSION_STARTED, |
117 content::NotificationService::AllSources()); | 124 content::NotificationService::AllSources()); |
118 | 125 |
119 SetProfile(ProfileManager::GetDefaultProfile()); | 126 SetProfile(ProfileManager::GetDefaultProfile()); |
120 | 127 |
121 network_icon_large_->SetResourceSize(NetworkMenuIcon::SIZE_LARGE); | 128 network_icon_large_->SetResourceSize(NetworkMenuIcon::SIZE_LARGE); |
122 | 129 |
123 accessibility_enabled_.Init(prefs::kSpokenFeedbackEnabled, | 130 accessibility_enabled_.Init(prefs::kSpokenFeedbackEnabled, |
124 g_browser_process->local_state(), this); | 131 g_browser_process->local_state(), this); |
132 | |
133 bluetooth_adapter_.reset(BluetoothAdapter::CreateDefaultAdapter()); | |
134 bluetooth_adapter_->AddObserver(this); | |
125 } | 135 } |
126 | 136 |
127 virtual ~SystemTrayDelegate() { | 137 virtual ~SystemTrayDelegate() { |
keybuk
2012/03/21 14:50:32
Since you have a BluetoothAdapter instance and hav
sadrul
2012/03/21 14:55:40
I didn't do it since bluetooth_adapter_ gets destr
keybuk
2012/03/21 14:58:57
sure, but it's safer to do so, since the CreateDef
sadrul
2012/03/21 15:52:34
Aha, good point! Done.
| |
128 AudioHandler* audiohandler = AudioHandler::GetInstance(); | 138 AudioHandler* audiohandler = AudioHandler::GetInstance(); |
129 if (audiohandler) | 139 if (audiohandler) |
130 audiohandler->RemoveVolumeObserver(this); | 140 audiohandler->RemoveVolumeObserver(this); |
131 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); | 141 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); |
132 input_method::InputMethodManager::GetInstance()->RemoveObserver(this); | 142 input_method::InputMethodManager::GetInstance()->RemoveObserver(this); |
133 system::TimezoneSettings::GetInstance()->RemoveObserver(this); | 143 system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
134 if (SystemKeyEventListener::GetInstance()) | 144 if (SystemKeyEventListener::GetInstance()) |
135 SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this); | 145 SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this); |
136 } | 146 } |
137 | 147 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 } | 196 } |
187 | 197 |
188 virtual void ShowDateSettings() OVERRIDE { | 198 virtual void ShowDateSettings() OVERRIDE { |
189 GetAppropriateBrowser()->OpenAdvancedOptionsDialog(); | 199 GetAppropriateBrowser()->OpenAdvancedOptionsDialog(); |
190 } | 200 } |
191 | 201 |
192 virtual void ShowNetworkSettings() OVERRIDE { | 202 virtual void ShowNetworkSettings() OVERRIDE { |
193 GetAppropriateBrowser()->OpenInternetOptionsDialog(); | 203 GetAppropriateBrowser()->OpenInternetOptionsDialog(); |
194 } | 204 } |
195 | 205 |
206 virtual void ShowBluetoothSettings() OVERRIDE { | |
207 // TODO | |
208 } | |
209 | |
196 virtual void ShowHelp() OVERRIDE { | 210 virtual void ShowHelp() OVERRIDE { |
197 GetAppropriateBrowser()->ShowHelpTab(); | 211 GetAppropriateBrowser()->ShowHelpTab(); |
198 } | 212 } |
199 | 213 |
200 virtual bool IsAudioMuted() const OVERRIDE { | 214 virtual bool IsAudioMuted() const OVERRIDE { |
201 return AudioHandler::GetInstance()->IsMuted(); | 215 return AudioHandler::GetInstance()->IsMuted(); |
202 } | 216 } |
203 | 217 |
204 virtual void SetAudioMuted(bool muted) OVERRIDE { | 218 virtual void SetAudioMuted(bool muted) OVERRIDE { |
205 return AudioHandler::GetInstance()->SetMuted(muted); | 219 return AudioHandler::GetInstance()->SetMuted(muted); |
(...skipping 23 matching lines...) Expand all Loading... | |
229 | 243 |
230 virtual void SignOut() OVERRIDE { | 244 virtual void SignOut() OVERRIDE { |
231 BrowserList::AttemptUserExit(); | 245 BrowserList::AttemptUserExit(); |
232 } | 246 } |
233 | 247 |
234 virtual void RequestLockScreen() OVERRIDE { | 248 virtual void RequestLockScreen() OVERRIDE { |
235 DBusThreadManager::Get()->GetPowerManagerClient()-> | 249 DBusThreadManager::Get()->GetPowerManagerClient()-> |
236 NotifyScreenLockRequested(); | 250 NotifyScreenLockRequested(); |
237 } | 251 } |
238 | 252 |
253 virtual ash::BluetoothDeviceList GetAvailableBluetoothDevices() OVERRIDE { | |
254 BluetoothAdapter::DeviceList devices = bluetooth_adapter_->GetDevices(); | |
255 ash::BluetoothDeviceList list; | |
256 for (size_t i = 0; i < devices.size(); ++i) { | |
257 BluetoothDevice* device = devices[i]; | |
258 ash::BluetoothDeviceInfo info; | |
259 info.address = device->address(); | |
260 info.display_name = device->GetName(); | |
261 info.connected = device->IsConnected(); | |
262 list.push_back(info); | |
263 } | |
264 return list; | |
265 } | |
266 | |
239 virtual ash::IMEInfoList GetAvailableIMEList() OVERRIDE { | 267 virtual ash::IMEInfoList GetAvailableIMEList() OVERRIDE { |
240 ash::IMEInfoList list; | 268 ash::IMEInfoList list; |
241 input_method::InputMethodManager* manager = | 269 input_method::InputMethodManager* manager = |
242 input_method::InputMethodManager::GetInstance(); | 270 input_method::InputMethodManager::GetInstance(); |
243 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); | 271 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); |
244 scoped_ptr<input_method::InputMethodDescriptors> ime_descriptors( | 272 scoped_ptr<input_method::InputMethodDescriptors> ime_descriptors( |
245 manager->GetActiveInputMethods()); | 273 manager->GetActiveInputMethods()); |
246 std::string current = manager->GetCurrentInputMethod().id(); | 274 std::string current = manager->GetCurrentInputMethod().id(); |
247 for (size_t i = 0; i < ime_descriptors->size(); i++) { | 275 for (size_t i = 0; i < ime_descriptors->size(); i++) { |
248 input_method::InputMethodDescriptor& ime = ime_descriptors->at(i); | 276 input_method::InputMethodDescriptor& ime = ime_descriptors->at(i); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 } | 348 } |
321 } | 349 } |
322 | 350 |
323 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { | 351 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { |
324 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); | 352 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); |
325 Network* network = crosnet->FindNetworkByPath(network_id); | 353 Network* network = crosnet->FindNetworkByPath(network_id); |
326 if (network) | 354 if (network) |
327 network_menu_->ConnectToNetwork(network); | 355 network_menu_->ConnectToNetwork(network); |
328 } | 356 } |
329 | 357 |
358 virtual void AddBluetoothDevice() OVERRIDE { | |
359 GetAppropriateBrowser()->OpenAddBluetoothDeviceDialog(); | |
360 } | |
361 | |
330 virtual void ToggleAirplaneMode() OVERRIDE { | 362 virtual void ToggleAirplaneMode() OVERRIDE { |
331 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); | 363 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); |
332 crosnet->EnableOfflineMode(!crosnet->offline_mode()); | 364 crosnet->EnableOfflineMode(!crosnet->offline_mode()); |
333 } | 365 } |
334 | 366 |
335 virtual void ToggleWifi() OVERRIDE { | 367 virtual void ToggleWifi() OVERRIDE { |
336 network_menu_->ToggleWifi(); | 368 network_menu_->ToggleWifi(); |
337 } | 369 } |
338 | 370 |
339 virtual void ToggleCellular() OVERRIDE { | 371 virtual void ToggleCellular() OVERRIDE { |
340 network_menu_->ToggleCellular(); | 372 network_menu_->ToggleCellular(); |
341 } | 373 } |
342 | 374 |
375 virtual void ToggleBluetooth() OVERRIDE { | |
376 bluetooth_adapter_->SetPowered(!bluetooth_adapter_->IsPowered(), | |
377 base::Bind(&BluetoothPowerFailure)); | |
keybuk
2012/03/21 14:50:32
I couldn't see the definition of BluetoothPowerFai
sadrul
2012/03/21 14:55:40
It's in line 71.
| |
378 } | |
379 | |
343 virtual bool GetWifiAvailable() OVERRIDE { | 380 virtual bool GetWifiAvailable() OVERRIDE { |
344 return CrosLibrary::Get()->GetNetworkLibrary()->wifi_available(); | 381 return CrosLibrary::Get()->GetNetworkLibrary()->wifi_available(); |
345 } | 382 } |
346 | 383 |
347 virtual bool GetCellularAvailable() OVERRIDE { | 384 virtual bool GetCellularAvailable() OVERRIDE { |
348 return CrosLibrary::Get()->GetNetworkLibrary()->cellular_available(); | 385 return CrosLibrary::Get()->GetNetworkLibrary()->cellular_available(); |
349 } | 386 } |
350 | 387 |
388 virtual bool GetBluetoothAvailable() OVERRIDE { | |
389 return bluetooth_adapter_->IsPresent(); | |
390 } | |
391 | |
351 virtual bool GetWifiEnabled() OVERRIDE { | 392 virtual bool GetWifiEnabled() OVERRIDE { |
352 return CrosLibrary::Get()->GetNetworkLibrary()->wifi_enabled(); | 393 return CrosLibrary::Get()->GetNetworkLibrary()->wifi_enabled(); |
353 } | 394 } |
354 | 395 |
355 virtual bool GetCellularEnabled() OVERRIDE { | 396 virtual bool GetCellularEnabled() OVERRIDE { |
356 return CrosLibrary::Get()->GetNetworkLibrary()->cellular_enabled(); | 397 return CrosLibrary::Get()->GetNetworkLibrary()->cellular_enabled(); |
357 } | 398 } |
358 | 399 |
400 virtual bool GetBluetoothEnabled() OVERRIDE { | |
401 return bluetooth_adapter_->IsPowered(); | |
402 } | |
403 | |
359 virtual void ChangeProxySettings() OVERRIDE { | 404 virtual void ChangeProxySettings() OVERRIDE { |
360 CHECK(GetUserLoginStatus() == ash::user::LOGGED_IN_NONE); | 405 CHECK(GetUserLoginStatus() == ash::user::LOGGED_IN_NONE); |
361 BaseLoginDisplayHost::default_host()->OpenProxySettings(); | 406 BaseLoginDisplayHost::default_host()->OpenProxySettings(); |
362 } | 407 } |
363 | 408 |
364 private: | 409 private: |
365 // Returns the last active browser. If there is no such browser, creates a new | 410 // Returns the last active browser. If there is no such browser, creates a new |
366 // browser window with an empty tab and returns it. | 411 // browser window with an empty tab and returns it. |
367 Browser* GetAppropriateBrowser() { | 412 Browser* GetAppropriateBrowser() { |
368 Browser* browser = BrowserList::GetLastActive(); | 413 Browser* browser = BrowserList::GetLastActive(); |
(...skipping 30 matching lines...) Expand all Loading... | |
399 void NotifyRefreshNetwork() { | 444 void NotifyRefreshNetwork() { |
400 ash::NetworkObserver* observer = | 445 ash::NetworkObserver* observer = |
401 ash::Shell::GetInstance()->tray()->network_observer(); | 446 ash::Shell::GetInstance()->tray()->network_observer(); |
402 if (observer) { | 447 if (observer) { |
403 ash::NetworkIconInfo info; | 448 ash::NetworkIconInfo info; |
404 info.image = network_icon_->GetIconAndText(&info.description); | 449 info.image = network_icon_->GetIconAndText(&info.description); |
405 observer->OnNetworkRefresh(info); | 450 observer->OnNetworkRefresh(info); |
406 } | 451 } |
407 } | 452 } |
408 | 453 |
454 void NotifyRefreshBluetooth() { | |
455 ash::BluetoothObserver* observer = | |
456 ash::Shell::GetInstance()->tray()->bluetooth_observer(); | |
457 if (observer) | |
458 observer->OnBluetoothRefresh(); | |
459 } | |
460 | |
409 void NotifyRefreshIME() { | 461 void NotifyRefreshIME() { |
410 ash::IMEObserver* observer = | 462 ash::IMEObserver* observer = |
411 ash::Shell::GetInstance()->tray()->ime_observer(); | 463 ash::Shell::GetInstance()->tray()->ime_observer(); |
412 if (observer) | 464 if (observer) |
413 observer->OnIMERefresh(); | 465 observer->OnIMERefresh(); |
414 } | 466 } |
415 | 467 |
416 void RefreshNetworkObserver(NetworkLibrary* crosnet) { | 468 void RefreshNetworkObserver(NetworkLibrary* crosnet) { |
417 const Network* network = crosnet->active_network(); | 469 const Network* network = crosnet->active_network(); |
418 std::string new_path = network ? network->service_path() : std::string(); | 470 std::string new_path = network ? network->service_path() : std::string(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 input_method::InputMethodManager* manager, | 635 input_method::InputMethodManager* manager, |
584 const input_method::InputMethodPropertyList& properties) OVERRIDE { | 636 const input_method::InputMethodPropertyList& properties) OVERRIDE { |
585 NotifyRefreshIME(); | 637 NotifyRefreshIME(); |
586 } | 638 } |
587 | 639 |
588 // Overridden from system::TimezoneSettings::Observer. | 640 // Overridden from system::TimezoneSettings::Observer. |
589 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE { | 641 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE { |
590 NotifyRefreshClock(); | 642 NotifyRefreshClock(); |
591 } | 643 } |
592 | 644 |
645 // Overridden from BluetoothAdapter::Observer. | |
646 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, | |
647 bool present) OVERRIDE { | |
648 NotifyRefreshBluetooth(); | |
649 } | |
650 | |
651 virtual void AdapterPoweredChanged(BluetoothAdapter* adapter, | |
652 bool powered) OVERRIDE { | |
653 NotifyRefreshBluetooth(); | |
654 } | |
655 | |
656 virtual void AdapterDiscoveringChanged(BluetoothAdapter* adapter, | |
657 bool discovering) OVERRIDE { | |
658 // Not necessary to do anything here? | |
659 } | |
660 | |
661 virtual void DeviceAdded(BluetoothAdapter* adapter, | |
662 BluetoothDevice* device) OVERRIDE { | |
663 NotifyRefreshBluetooth(); | |
664 } | |
665 | |
666 virtual void DeviceChanged(BluetoothAdapter* adapter, | |
667 BluetoothDevice* device) OVERRIDE { | |
668 NotifyRefreshBluetooth(); | |
669 } | |
670 | |
671 virtual void DeviceRemoved(BluetoothAdapter* adapter, | |
672 BluetoothDevice* device) OVERRIDE { | |
673 NotifyRefreshBluetooth(); | |
674 } | |
675 | |
593 // Overridden from SystemKeyEventListener::CapsLockObserver. | 676 // Overridden from SystemKeyEventListener::CapsLockObserver. |
594 virtual void OnCapsLockChange(bool enabled) OVERRIDE { | 677 virtual void OnCapsLockChange(bool enabled) OVERRIDE { |
595 ash::CapsLockObserver* observer = | 678 ash::CapsLockObserver* observer = |
596 ash::Shell::GetInstance()->tray()->caps_lock_observer(); | 679 ash::Shell::GetInstance()->tray()->caps_lock_observer(); |
597 if (observer) | 680 if (observer) |
598 observer->OnCapsLockChanged(enabled); | 681 observer->OnCapsLockChanged(enabled); |
599 } | 682 } |
600 | 683 |
601 ash::SystemTray* tray_; | 684 ash::SystemTray* tray_; |
602 scoped_ptr<NetworkMenuIcon> network_icon_; | 685 scoped_ptr<NetworkMenuIcon> network_icon_; |
603 scoped_ptr<NetworkMenuIcon> network_icon_large_; | 686 scoped_ptr<NetworkMenuIcon> network_icon_large_; |
604 scoped_ptr<NetworkMenu> network_menu_; | 687 scoped_ptr<NetworkMenu> network_menu_; |
605 content::NotificationRegistrar registrar_; | 688 content::NotificationRegistrar registrar_; |
606 scoped_ptr<PrefChangeRegistrar> pref_registrar_; | 689 scoped_ptr<PrefChangeRegistrar> pref_registrar_; |
607 std::string cellular_device_path_; | 690 std::string cellular_device_path_; |
608 std::string active_network_path_; | 691 std::string active_network_path_; |
609 scoped_ptr<LoginHtmlDialog> proxy_settings_dialog_; | 692 scoped_ptr<LoginHtmlDialog> proxy_settings_dialog_; |
610 PowerSupplyStatus power_supply_status_; | 693 PowerSupplyStatus power_supply_status_; |
611 base::HourClockType clock_type_; | 694 base::HourClockType clock_type_; |
612 | 695 |
696 scoped_ptr<BluetoothAdapter> bluetooth_adapter_; | |
697 | |
613 BooleanPrefMember accessibility_enabled_; | 698 BooleanPrefMember accessibility_enabled_; |
614 | 699 |
615 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 700 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
616 }; | 701 }; |
617 | 702 |
618 } // namespace | 703 } // namespace |
619 | 704 |
620 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 705 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
621 return new chromeos::SystemTrayDelegate(tray); | 706 return new chromeos::SystemTrayDelegate(tray); |
622 } | 707 } |
623 | 708 |
624 } // namespace chromeos | 709 } // namespace chromeos |
OLD | NEW |