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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 8f5dd3426818dbfa54ebe486b1add3f2b825e49a..261fe058b4f91239f5c0caa4db76c3e9dc6d3cb8 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
@@ -101,8 +101,8 @@ class DeviceEmulatorMessageHandler::BluetoothObserver
void DeviceEmulatorMessageHandler::BluetoothObserver::DeviceAdded(
const dbus::ObjectPath& object_path) {
- scoped_ptr<base::DictionaryValue> device = owner_->GetDeviceInfo(
- object_path);
+ std::unique_ptr<base::DictionaryValue> device =
+ owner_->GetDeviceInfo(object_path);
// Request to add the device to the view's list of devices.
owner_->web_ui()->CallJavascriptFunction(kAddBluetoothDeviceJSCallback,
@@ -239,11 +239,11 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothInfo(
base::ListValue devices;
// Get each device's properties.
for (const dbus::ObjectPath& path : paths) {
- scoped_ptr<base::DictionaryValue> device = GetDeviceInfo(path);
+ std::unique_ptr<base::DictionaryValue> device = GetDeviceInfo(path);
devices.Append(std::move(device));
}
- scoped_ptr<base::ListValue> predefined_devices =
+ std::unique_ptr<base::ListValue> predefined_devices =
fake_bluetooth_device_client_->GetBluetoothDevicesAsDictionaries();
base::ListValue pairing_method_options;
@@ -293,7 +293,8 @@ void DeviceEmulatorMessageHandler::HandleRequestAudioNodes(
// send it to JavaScript.
base::ListValue audio_nodes;
for (const AudioNode& node : fake_cras_audio_client_->node_list()) {
- scoped_ptr<base::DictionaryValue> audio_node(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> audio_node(
+ new base::DictionaryValue());
audio_node->SetBoolean("isInput", node.is_input);
audio_node->SetString("id", base::Uint64ToString(node.id));
@@ -531,13 +532,14 @@ std::string DeviceEmulatorMessageHandler::CreateBluetoothDeviceFromListValue(
return props.device_path;
}
-scoped_ptr<base::DictionaryValue> DeviceEmulatorMessageHandler::GetDeviceInfo(
+std::unique_ptr<base::DictionaryValue>
+DeviceEmulatorMessageHandler::GetDeviceInfo(
const dbus::ObjectPath& object_path) {
// Get the device's properties.
bluez::FakeBluetoothDeviceClient::Properties* props =
fake_bluetooth_device_client_->GetProperties(object_path);
- scoped_ptr<base::DictionaryValue> device(new base::DictionaryValue());
- scoped_ptr<base::ListValue> uuids(new base::ListValue);
+ std::unique_ptr<base::DictionaryValue> device(new base::DictionaryValue());
+ std::unique_ptr<base::ListValue> uuids(new base::ListValue);
bluez::FakeBluetoothDeviceClient::SimulatedPairingOptions* options =
fake_bluetooth_device_client_->GetPairingOptions(object_path);

Powered by Google App Engine
This is Rietveld 408576698