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

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

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 5f1f17d80fd8cbbf46a3aa0ec0a1669596f1f193..faa2573d59e5c5afb1d408bc3327cc50fbb3d4a5 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
@@ -106,24 +106,25 @@ void DeviceEmulatorMessageHandler::BluetoothObserver::DeviceAdded(
owner_->GetDeviceInfo(object_path);
// Request to add the device to the view's list of devices.
- owner_->web_ui()->CallJavascriptFunction(kAddBluetoothDeviceJSCallback,
- *device);
+ owner_->web_ui()->CallJavascriptFunctionUnsafe(kAddBluetoothDeviceJSCallback,
+ *device);
}
void DeviceEmulatorMessageHandler::BluetoothObserver::DevicePropertyChanged(
const dbus::ObjectPath& object_path,
const std::string& property_name) {
if (property_name == kPairedPropertyName) {
- owner_->web_ui()->CallJavascriptFunction(kDevicePairedFromTrayJSCallback,
+ owner_->web_ui()->CallJavascriptFunctionUnsafe(
+ kDevicePairedFromTrayJSCallback,
base::StringValue(object_path.value()));
}
}
void DeviceEmulatorMessageHandler::BluetoothObserver::DeviceRemoved(
const dbus::ObjectPath& object_path) {
- owner_->web_ui()->CallJavascriptFunction(
- kDeviceRemovedFromMainAdapterJSCallback,
- base::StringValue(object_path.value()));
+ owner_->web_ui()->CallJavascriptFunctionUnsafe(
+ kDeviceRemovedFromMainAdapterJSCallback,
+ base::StringValue(object_path.value()));
}
class DeviceEmulatorMessageHandler::CrasAudioObserver
@@ -185,8 +186,8 @@ void DeviceEmulatorMessageHandler::PowerObserver::PowerChanged(
power_properties.SetString("external_power_source_id",
proto.external_power_source_id());
- owner_->web_ui()->CallJavascriptFunction(kUpdatePowerPropertiesJSCallback,
- power_properties);
+ owner_->web_ui()->CallJavascriptFunctionUnsafe(
+ kUpdatePowerPropertiesJSCallback, power_properties);
}
DeviceEmulatorMessageHandler::DeviceEmulatorMessageHandler()
@@ -264,9 +265,9 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothInfo(
bluez::FakeBluetoothDeviceClient::kPairingActionFail);
// Send the list of devices to the view.
- web_ui()->CallJavascriptFunction(kUpdateBluetoothInfoJSCallback,
- *predefined_devices, devices, pairing_method_options,
- pairing_action_options);
+ web_ui()->CallJavascriptFunctionUnsafe(
+ kUpdateBluetoothInfoJSCallback, *predefined_devices, devices,
+ pairing_method_options, pairing_action_options);
}
void DeviceEmulatorMessageHandler::HandleRequestBluetoothPair(
@@ -281,8 +282,8 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothPair(
ash::Shell::GetInstance()->system_tray_delegate()->ConnectToBluetoothDevice(
props->address.value());
if (!props->paired.value()) {
- web_ui()->CallJavascriptFunction(kPairFailedJSCallback,
- base::StringValue(path));
+ web_ui()->CallJavascriptFunctionUnsafe(kPairFailedJSCallback,
+ base::StringValue(path));
}
}
@@ -304,7 +305,7 @@ void DeviceEmulatorMessageHandler::HandleRequestAudioNodes(
audio_nodes.Append(std::move(audio_node));
}
- web_ui()->CallJavascriptFunction(kUpdateAudioNodes, audio_nodes);
+ web_ui()->CallJavascriptFunctionUnsafe(kUpdateAudioNodes, audio_nodes);
}
void DeviceEmulatorMessageHandler::HandleInsertAudioNode(

Powered by Google App Engine
This is Rietveld 408576698