Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9444)

Unified Diff: chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc

Issue 1206733002: ChromeOs Power Emulation Impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New Impl, Work with UI Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
index e2c534a5b45f45fb008f1c9a15f05085d7747eaf..d8cc5ac4f8f98ad96b00036b003a47bce7b06743 100644
--- a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
@@ -8,6 +8,8 @@
#include "base/bind.h"
#include "base/values.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/fake_power_manager_client.h"
#include "content/public/browser/web_ui.h"
namespace {
@@ -52,6 +54,12 @@ void DeviceEmulatorMessageHandler::HandleUpdateBatteryInfo(
const base::ListValue* args) {
int new_percent = -1;
args->GetInteger(0, &new_percent);
+ static_cast<chromeos::FakePowerManagerClient*>(
+ chromeos::DBusThreadManager::Get()->GetPowerManagerClient())
+ ->UpdatePowerProperties(
+ new_percent, false,
+ power_manager::PowerSupplyProperties_BatteryState_DISCHARGING,
+ power_manager::PowerSupplyProperties_ExternalPower_DISCONNECTED);
mozartalouis 2015/06/30 02:16:08 Not sure if this is the best way to do this, pleas
}
void DeviceEmulatorMessageHandler::HandleUpdatePowerSource(

Powered by Google App Engine
This is Rietveld 408576698