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

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

Issue 1999593002: Update chrome://device-emulator with newer Polymer guidelines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 261fe058b4f91239f5c0caa4db76c3e9dc6d3cb8..cab57e271c7d22b00f280cc6707d1b68ea6f49e7 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
@@ -24,6 +24,7 @@
namespace {
// Define the name of the callback functions that will be used by JavaScript.
+const char kInitialize[] = "initialize";
const char kBluetoothDiscoverFunction[] = "requestBluetoothDiscover";
const char kBluetoothPairFunction[] = "requestBluetoothPair";
const char kRequestBluetoothInfo[] = "requestBluetoothInfo";
@@ -203,7 +204,7 @@ DeviceEmulatorMessageHandler::DeviceEmulatorMessageHandler()
DeviceEmulatorMessageHandler::~DeviceEmulatorMessageHandler() {
}
-void DeviceEmulatorMessageHandler::Init() {
+void DeviceEmulatorMessageHandler::Init(const base::ListValue* args) {
bluetooth_observer_.reset(new BluetoothObserver(this));
cras_audio_observer_.reset(new CrasAudioObserver(this));
power_observer_.reset(new PowerObserver(this));
@@ -450,6 +451,9 @@ void DeviceEmulatorMessageHandler::UpdatePowerSourceId(
void DeviceEmulatorMessageHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
+ kInitialize,
+ base::Bind(&DeviceEmulatorMessageHandler::Init, base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
kRequestPowerInfo,
base::Bind(&DeviceEmulatorMessageHandler::RequestPowerInfo,
base::Unretained(this)));

Powered by Google App Engine
This is Rietveld 408576698