Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h |
| diff --git a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h |
| index e56c87f54c0badf71ff5923c89ae0b1fec90ef51..b32d617d3d9bb81f5a41f06cd19c2b84cdf388d0 100644 |
| --- a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h |
| +++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h |
| @@ -5,7 +5,7 @@ |
| #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLER_H_ |
| #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLER_H_ |
| -#include "chromeos/dbus/fake_power_manager_client.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" |
| #include "content/public/browser/web_ui_message_handler.h" |
| @@ -13,17 +13,24 @@ namespace base { |
| class ListValue; |
| } |
| +namespace dbus { |
| +class ObjectPath; |
| +} |
| + |
| +namespace chromeos { |
| + |
| +class FakeBluetoothDeviceClient; |
| +class FakePowerManagerClient; |
| + |
| // Handler class for the Device Emulator page operations. |
| class DeviceEmulatorMessageHandler |
| - : public content::WebUIMessageHandler, |
| - public chromeos::PowerManagerClient::Observer { |
| + : public content::WebUIMessageHandler { |
| public: |
| DeviceEmulatorMessageHandler(); |
| ~DeviceEmulatorMessageHandler() override; |
| - // Callbacks for JS request methods. All these methods work |
| - // asynchronously. |
| - void RequestPowerInfo(const base::ListValue* args); |
| + // Adds |this| as an observer to all necessary objects. |
| + void Init(); |
| // Callback for the "requestBluetoothDiscover" message. This asynchronously |
| // requests for the system to discover a certain device. The device's data |
| @@ -31,6 +38,10 @@ class DeviceEmulatorMessageHandler |
| // already exist, then it will be created and attached to the main adapter. |
| void HandleRequestBluetoothDiscover(const base::ListValue* args); |
| + // Callback for the "requestBluetoothInfo" message. This asynchronously |
| + // requests for the devices which are already paired with the device. |
| + void HandleRequestBluetoothInfo(const base::ListValue* args); |
| + |
| // Callback for the "requestBluetoothPair" message. This asynchronously |
| // requests for the system to pair a certain device. The device's data should |
| // be passed into |args| as a dictionary. If the device does not already |
| @@ -44,19 +55,36 @@ class DeviceEmulatorMessageHandler |
| void UpdateTimeToEmpty(const base::ListValue* args); |
| void UpdateTimeToFull(const base::ListValue* args); |
| - // Adds |this| as an observer to all necessary objects. |
| - void Init(); |
| - |
| - // chromeos::PowerManagerClient::Observer: |
| - void PowerChanged(const power_manager::PowerSupplyProperties& proto) override; |
| - |
| // content::WebUIMessageHandler: |
| void RegisterMessages() override; |
| + // Callbacks for JS request methods. All these methods work |
| + // asynchronously. |
| + void RequestPowerInfo(const base::ListValue* args); |
| + |
| private: |
| - chromeos::FakePowerManagerClient* fake_power_manager_client_; |
| + class BluetoothObserver; |
| + class PowerObserver; |
| + |
| + // Creates a bluetooth device with the properties given in |args|. |args| |
| + // should contain a dictionary so that each dictionary value can be mapped |
| + // to its respective property upon creating the device. Returns the device |
| + // path. |
| + std::string CreateBluetoothDeviceFromListValue(const base::ListValue* args); |
| + |
| + // Builds a dictionary with each key representing a property of the device |
| + // with path |object_path|. |
| + scoped_ptr<base::DictionaryValue> GetDeviceInfo( |
| + const dbus::ObjectPath& object_path); |
| + |
| + scoped_ptr<BluetoothObserver> bluetooth_observer_; |
| + FakeBluetoothDeviceClient* fake_bluetooth_device_client_; |
| + FakePowerManagerClient* fake_power_manager_client_; |
| + scoped_ptr<PowerObserver> power_observer_; |
|
oshima
2015/07/31 21:33:58
can you sort and group them together ?
FakeBlutoo
rfrappier
2015/07/31 22:43:03
Done.
|
| DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler); |
| }; |
| +} // namespace chromeos |
| + |
| #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLER_H_ |