| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLE
R_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLE
R_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLE
R_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLE
R_H_ |
| 7 | 7 |
| 8 #include "chromeos/dbus/fake_power_manager_client.h" | 8 #include "chromeos/dbus/fake_power_manager_client.h" |
| 9 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" | 9 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" |
| 10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Callback for the "requestBluetoothPair" message. This asynchronously | 34 // Callback for the "requestBluetoothPair" message. This asynchronously |
| 35 // requests for the system to pair a certain device. The device's data should | 35 // requests for the system to pair a certain device. The device's data should |
| 36 // be passed into |args| as a dictionary. If the device does not already | 36 // be passed into |args| as a dictionary. If the device does not already |
| 37 // exist, then it will be created and attached to the main adapter. | 37 // exist, then it will be created and attached to the main adapter. |
| 38 void HandleRequestBluetoothPair(const base::ListValue* args); | 38 void HandleRequestBluetoothPair(const base::ListValue* args); |
| 39 | 39 |
| 40 // Callbacks for JS update methods. All these methods work | 40 // Callbacks for JS update methods. All these methods work |
| 41 // asynchronously. | 41 // asynchronously. |
| 42 void UpdateBatteryPercent(const base::ListValue* args); | 42 void UpdateBatteryPercent(const base::ListValue* args); |
| 43 void UpdateBatteryState(const base::ListValue* args); |
| 43 void UpdateExternalPower(const base::ListValue* args); | 44 void UpdateExternalPower(const base::ListValue* args); |
| 44 void UpdateTimeToEmpty(const base::ListValue* args); | 45 void UpdateTimeToEmpty(const base::ListValue* args); |
| 45 void UpdateTimeToFull(const base::ListValue* args); | 46 void UpdateTimeToFull(const base::ListValue* args); |
| 46 | 47 |
| 47 // Adds |this| as an observer to all necessary objects. | 48 // Adds |this| as an observer to all necessary objects. |
| 48 void Init(); | 49 void Init(); |
| 49 | 50 |
| 50 // chromeos::PowerManagerClient::Observer: | 51 // chromeos::PowerManagerClient::Observer: |
| 51 void PowerChanged(const power_manager::PowerSupplyProperties& proto) override; | 52 void PowerChanged(const power_manager::PowerSupplyProperties& proto) override; |
| 52 | 53 |
| 53 // content::WebUIMessageHandler: | 54 // content::WebUIMessageHandler: |
| 54 void RegisterMessages() override; | 55 void RegisterMessages() override; |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 chromeos::FakePowerManagerClient* fake_power_manager_client_; | 58 chromeos::FakePowerManagerClient* fake_power_manager_client_; |
| 58 | 59 |
| 59 DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler); | 60 DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HAN
DLER_H_ | 63 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HAN
DLER_H_ |
| OLD | NEW |