Chromium Code Reviews| Index: ash/shell.cc |
| diff --git a/ash/shell.cc b/ash/shell.cc |
| index dea97860e0dc22adabb5590cbc9e719de39521c4..8f67847f21dd269881cb3dc062b9c47561d034ca 100644 |
| --- a/ash/shell.cc |
| +++ b/ash/shell.cc |
| @@ -20,6 +20,7 @@ |
| #include "ash/shell_factory.h" |
| #include "ash/shell_window_ids.h" |
| #include "ash/system/audio/tray_volume.h" |
| +#include "ash/system/bluetooth/tray_bluetooth.h" |
| #include "ash/system/brightness/tray_brightness.h" |
| #include "ash/system/ime/tray_ime.h" |
| #include "ash/system/network/tray_network.h" |
| @@ -231,6 +232,7 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| : muted_(false), |
| wifi_enabled_(true), |
| cellular_enabled_(true), |
| + bluetooth_enabled_(true), |
| volume_(0.5) { |
| } |
| @@ -280,6 +282,9 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| virtual void ShowNetworkSettings() OVERRIDE { |
| } |
| + virtual void ShowBluetoothSettings() OVERRIDE { |
| + } |
| + |
| virtual void ShowHelp() OVERRIDE { |
| } |
| @@ -315,6 +320,10 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| virtual void RequestLockScreen() OVERRIDE {} |
| + virtual BluetoothDeviceList GetAvailableBluetoothDevices() OVERRIDE { |
|
Ben Goodger (Google)
2012/03/21 15:52:14
what is this?
sadrul
2012/03/21 16:16:42
It would return the list of 'available' (currently
|
| + return BluetoothDeviceList(); |
| + } |
| + |
| virtual IMEInfoList GetAvailableIMEList() { |
| return IMEInfoList(); |
| } |
| @@ -330,6 +339,9 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { |
| } |
| + virtual void AddBluetoothDevice() OVERRIDE { |
| + } |
| + |
| virtual void ToggleAirplaneMode() OVERRIDE { |
| } |
| @@ -353,6 +365,14 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| } |
| } |
| + virtual void ToggleBluetooth() OVERRIDE { |
| + bluetooth_enabled_ = !bluetooth_enabled_; |
| + ash::BluetoothObserver* observer = |
| + ash::Shell::GetInstance()->tray()->bluetooth_observer(); |
| + if (observer) |
| + observer->OnBluetoothRefresh(); |
| + } |
| + |
| virtual bool GetWifiAvailable() OVERRIDE { |
| return true; |
| } |
| @@ -361,6 +381,10 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| return true; |
| } |
| + virtual bool GetBluetoothAvailable() OVERRIDE { |
| + return true; |
| + } |
| + |
| virtual bool GetWifiEnabled() OVERRIDE { |
| return wifi_enabled_; |
| } |
| @@ -369,12 +393,17 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { |
| return cellular_enabled_; |
| } |
| + virtual bool GetBluetoothEnabled() OVERRIDE { |
| + return bluetooth_enabled_; |
| + } |
| + |
| virtual void ChangeProxySettings() OVERRIDE { |
| } |
| bool muted_; |
| bool wifi_enabled_; |
| bool cellular_enabled_; |
| + bool bluetooth_enabled_; |
| float volume_; |
| SkBitmap null_image_; |
| @@ -566,6 +595,7 @@ void Shell::Init() { |
| tray_delegate_.reset(new DummySystemTrayDelegate()); |
| internal::TrayVolume* tray_volume = new internal::TrayVolume(); |
| + internal::TrayBluetooth* tray_bluetooth = new internal::TrayBluetooth(); |
| internal::TrayBrightness* tray_brightness = new internal::TrayBrightness(); |
| internal::TrayPowerDate* tray_power_date = new internal::TrayPowerDate(); |
| internal::TrayNetwork* tray_network = new internal::TrayNetwork; |
| @@ -577,6 +607,7 @@ void Shell::Init() { |
| tray_->accessibility_observer_ = tray_accessibility; |
| tray_->audio_observer_ = tray_volume; |
| + tray_->bluetooth_observer_ = tray_bluetooth; |
| tray_->brightness_observer_ = tray_brightness; |
| tray_->caps_lock_observer_ = tray_caps_lock; |
| tray_->clock_observer_ = tray_power_date; |
| @@ -590,6 +621,7 @@ void Shell::Init() { |
| tray_->AddTrayItem(new internal::TrayEmpty()); |
| tray_->AddTrayItem(tray_power_date); |
| tray_->AddTrayItem(tray_network); |
| + tray_->AddTrayItem(tray_bluetooth); |
| tray_->AddTrayItem(tray_ime); |
| tray_->AddTrayItem(tray_volume); |
| tray_->AddTrayItem(tray_brightness); |