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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 bool rv = args->GetString(0, &device); | 203 bool rv = args->GetString(0, &device); |
204 DCHECK(rv); | 204 DCHECK(rv); |
205 | 205 |
206 DeviceDescriptionMap::iterator found = device_descriptions_.find(device); | 206 DeviceDescriptionMap::iterator found = device_descriptions_.find(device); |
207 if (found == device_descriptions_.end()) { | 207 if (found == device_descriptions_.end()) { |
208 OnSetupError(); | 208 OnSetupError(); |
209 return; | 209 return; |
210 } | 210 } |
211 | 211 |
212 if (found->second.version < kCloudDevicesPrivetVersion) { | 212 if (found->second.version < kCloudDevicesPrivetVersion) { |
213 privet_resolution_ = privet_http_factory_->CreatePrivetHTTP( | 213 privet_resolution_ = privet_http_factory_->CreatePrivetHTTP(device); |
214 device, found->second.address, | 214 privet_resolution_->Start( |
| 215 found->second.address, |
215 base::Bind(&LocalDiscoveryUIHandler::StartRegisterHTTP, | 216 base::Bind(&LocalDiscoveryUIHandler::StartRegisterHTTP, |
216 base::Unretained(this))); | 217 base::Unretained(this))); |
217 privet_resolution_->Start(); | |
218 } else { | 218 } else { |
219 OnSetupError(); | 219 OnSetupError(); |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 void LocalDiscoveryUIHandler::HandleCancelRegistration( | 223 void LocalDiscoveryUIHandler::HandleCancelRegistration( |
224 const base::ListValue* args) { | 224 const base::ListValue* args) { |
225 ResetCurrentRegistration(); | 225 ResetCurrentRegistration(); |
226 } | 226 } |
227 | 227 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 | 640 |
641 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { | 641 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { |
642 if (cloud_print_connector_ui_enabled_) | 642 if (cloud_print_connector_ui_enabled_) |
643 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> | 643 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> |
644 RefreshStatusFromService(); | 644 RefreshStatusFromService(); |
645 } | 645 } |
646 | 646 |
647 #endif // cloud print connector option stuff | 647 #endif // cloud print connector option stuff |
648 | 648 |
649 } // namespace local_discovery | 649 } // namespace local_discovery |
OLD | NEW |