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

Unified Diff: components/pairing/bluetooth_controller_pairing_controller.cc

Issue 1428353002: Network Setup from Shark to Remora. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address achuithb@'s comment. Created 5 years, 1 month 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: components/pairing/bluetooth_controller_pairing_controller.cc
diff --git a/components/pairing/bluetooth_controller_pairing_controller.cc b/components/pairing/bluetooth_controller_pairing_controller.cc
index 3d8cb6a85dc9ee3135ff6b8f8ebc4d8dfbfd292e..8f744bb96b178095ca2d321bb7e93b24c4cca8e9 100644
--- a/components/pairing/bluetooth_controller_pairing_controller.cc
+++ b/components/pairing/bluetooth_controller_pairing_controller.cc
@@ -312,6 +312,19 @@ void BluetoothControllerPairingController::SetConfirmationCodeIsCorrect(
}
}
+void BluetoothControllerPairingController::SetHostNetwork(
+ const std::string& onc_spec) {
+ pairing_api::AddNetwork add_network;
+ add_network.set_api_version(kPairingAPIVersion);
+ add_network.mutable_parameters()->set_onc_spec(onc_spec);
+
+ int size = 0;
+ scoped_refptr<net::IOBuffer> io_buffer(
+ ProtoDecoder::SendHostNetwork(add_network, &size));
+
+ SendBuffer(io_buffer, size);
+}
+
void BluetoothControllerPairingController::SetHostConfiguration(
bool accepted_eula,
const std::string& lang,
@@ -325,10 +338,13 @@ void BluetoothControllerPairingController::SetHostConfiguration(
pairing_api::ConfigureHost host_config;
host_config.set_api_version(kPairingAPIVersion);
host_config.mutable_parameters()->set_accepted_eula(accepted_eula);
- host_config.mutable_parameters()->set_lang(lang);
- host_config.mutable_parameters()->set_timezone(timezone);
+ if (!lang.empty())
+ host_config.mutable_parameters()->set_lang(lang);
+ if (!timezone.empty())
+ host_config.mutable_parameters()->set_timezone(timezone);
host_config.mutable_parameters()->set_send_reports(send_reports);
- host_config.mutable_parameters()->set_keyboard_layout(keyboard_layout);
+ if (!keyboard_layout.empty())
+ host_config.mutable_parameters()->set_keyboard_layout(keyboard_layout);
int size = 0;
scoped_refptr<net::IOBuffer> io_buffer(

Powered by Google App Engine
This is Rietveld 408576698