| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 const CredentialsCallback& callback) { | 385 const CredentialsCallback& callback) { |
| 386 callback.Run("", ""); | 386 callback.Run("", ""); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void LocalDiscoveryUIHandler::SwitchToSetupWiFi( | 389 void LocalDiscoveryUIHandler::SwitchToSetupWiFi( |
| 390 const ResultCallback& callback) { | 390 const ResultCallback& callback) { |
| 391 callback.Run(true); | 391 callback.Run(true); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void LocalDiscoveryUIHandler::ConfirmSecurityCode( | 394 void LocalDiscoveryUIHandler::ConfirmSecurityCode( |
| 395 const std::string& confirmation_code, | |
| 396 const ResultCallback& callback) { | 395 const ResultCallback& callback) { |
| 397 device_code_callback_ = callback; | 396 device_code_callback_ = callback; |
| 398 web_ui()->CallJavascriptFunction( | 397 web_ui()->CallJavascriptFunction( |
| 399 "local_discovery.onRegistrationConfirmDeviceCode", | 398 "local_discovery.onRegistrationConfirmDeviceCode", |
| 400 base::StringValue(confirmation_code)); | 399 base::StringValue("1234")); |
| 401 } | 400 } |
| 402 | 401 |
| 403 void LocalDiscoveryUIHandler::RestoreWifi(const ResultCallback& callback) { | 402 void LocalDiscoveryUIHandler::RestoreWifi(const ResultCallback& callback) { |
| 404 callback.Run(true); | 403 callback.Run(true); |
| 405 } | 404 } |
| 406 | 405 |
| 407 void LocalDiscoveryUIHandler::OnSetupDone() { | 406 void LocalDiscoveryUIHandler::OnSetupDone() { |
| 408 std::string service_name = current_setup_operation_->service_name(); | 407 std::string service_name = current_setup_operation_->service_name(); |
| 409 current_setup_operation_.reset(); | 408 current_setup_operation_.reset(); |
| 410 current_register_operation_.reset(); | 409 current_register_operation_.reset(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); | 789 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); |
| 791 | 790 |
| 792 web_ui()->CallJavascriptFunction( | 791 web_ui()->CallJavascriptFunction( |
| 793 "local_discovery.onUnregisteredDeviceUpdate", service_key, *null_value); | 792 "local_discovery.onUnregisteredDeviceUpdate", service_key, *null_value); |
| 794 } | 793 } |
| 795 } | 794 } |
| 796 | 795 |
| 797 #endif // ENABLE_WIFI_BOOTSTRAPPING | 796 #endif // ENABLE_WIFI_BOOTSTRAPPING |
| 798 | 797 |
| 799 } // namespace local_discovery | 798 } // namespace local_discovery |
| OLD | NEW |