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

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

Issue 1205753002: Create chrome://device-emulator and add the ability to get a battery percentage and send an updated… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.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
new file mode 100644
index 0000000000000000000000000000000000000000..da23b1ecd54d357b0f94c74464a6e1ec52974dd7
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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 "content/public/browser/web_ui_message_handler.h"
+
+namespace power_manager {
+class PowerSupplyProperties;
+}
+
+namespace base {
+class ListValue;
+}
+
+// Handler class for the Device Emulator page operations.
+class DeviceEmulatorMessageHandler : public content::WebUIMessageHandler {
+ public:
+ DeviceEmulatorMessageHandler();
+ ~DeviceEmulatorMessageHandler() override;
+
+ // content::WebUIMessageHandler:
+ void RegisterMessages() override;
+
+ // Callback for the "requestBatteryInfo" message. This asynchronously
+ // requests the emulator's battery percentage.
+ void HandleRequestBatteryInfo(const base::ListValue* args);
+
+ // Callback for the "updateBatteryInfo" message. This asynchronously
+ // updates the emulator's battery percentage to a given percentage
+ // contained in args.
+ void HandleUpdateBatteryInfo(const base::ListValue* args);
+
+ // Callback for the "updatePowerSource" message. This asynchronously
+ // updates the emulator's power source based on the given parameter
+ // in args.
+ void HandleUpdatePowerSource(const base::ListValue* args);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698