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

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..0b707eebb6b606251861264fec7f5f8d43232e28
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
@@ -0,0 +1,35 @@
+// 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 chromeos {
oshima 2015/06/24 22:33:55 No namespace under chrome/browser. Some files st
rfrappier 2015/06/24 23:22:27 Done.
+
+extern const char kBatteryPercentFunction[];
michaelpg 2015/06/24 23:33:48 I would say "don't add needless externs; if you mu
+extern const char kUpdateBatteryPercentFunction[];
+extern const char kUpdatePowerModeFunction[];
+extern const char kBatteryPercentFunctionJSCallback[];
+
oshima 2015/06/24 22:33:55 document the class.
rfrappier 2015/06/24 23:22:27 Done.
+class DeviceEmulatorMessageHandler : public content::WebUIMessageHandler {
+ public:
+ DeviceEmulatorMessageHandler();
+ ~DeviceEmulatorMessageHandler() override;
+
+ // content::WebUIMessageHandler
oshima 2015/06/24 22:33:55 // content::WebUIMessageHandler:
rfrappier 2015/06/24 23:22:27 Done.
+ void RegisterMessages() override;
+
+ virtual void HandleRequestBatteryInfo(const base::ListValue* args);
michaelpg 2015/06/24 23:33:48 add fwd declaration: namespace base { class ListVa
rfrappier 2015/06/25 17:09:21 Done.
+ virtual void HandleUpdateBatteryInfo(const base::ListValue* args);
+ virtual void HandleUpdatePowerMode(const base::ListValue* args);
oshima 2015/06/24 22:33:55 do they have to be virtual?
rfrappier 2015/06/24 23:22:27 No, they don't. I just had it like that because I
rfrappier 2015/06/24 23:22:27 Done.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698