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( |