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

Side by Side Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc

Issue 959503003: Remove ServiceDiscoveryClient* from PrivetHTTPAsynchronousFactoryImpl interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixEstablish
Patch Set: Tue Feb 24 23:11:53 PST 2015 Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 void LocalDiscoveryUIHandler::HandleStart(const base::ListValue* args) { 164 void LocalDiscoveryUIHandler::HandleStart(const base::ListValue* args) {
165 Profile* profile = Profile::FromWebUI(web_ui()); 165 Profile* profile = Profile::FromWebUI(web_ui());
166 166
167 // If privet_lister_ is already set, it is a mock used for tests or the result 167 // If privet_lister_ is already set, it is a mock used for tests or the result
168 // of a reload. 168 // of a reload.
169 if (!privet_lister_) { 169 if (!privet_lister_) {
170 service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance(); 170 service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance();
171 privet_lister_.reset( 171 privet_lister_.reset(
172 new PrivetDeviceListerImpl(service_discovery_client_.get(), this)); 172 new PrivetDeviceListerImpl(service_discovery_client_.get(), this));
173 privet_http_factory_ = PrivetHTTPAsynchronousFactory::CreateInstance( 173 privet_http_factory_ = PrivetHTTPAsynchronousFactory::CreateInstance(
174 service_discovery_client_.get(), profile->GetRequestContext()); 174 profile->GetRequestContext());
175 175
176 SigninManagerBase* signin_manager = 176 SigninManagerBase* signin_manager =
177 SigninManagerFactory::GetInstance()->GetForProfile(profile); 177 SigninManagerFactory::GetInstance()->GetForProfile(profile);
178 if (signin_manager) 178 if (signin_manager)
179 signin_manager->AddObserver(this); 179 signin_manager->AddObserver(this);
180 } 180 }
181 181
182 privet_lister_->Start(); 182 privet_lister_->Start();
183 privet_lister_->DiscoverNewDevices(false); 183 privet_lister_->DiscoverNewDevices(false);
184 184
(...skipping 19 matching lines...) Expand all
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(
214 device, 214 device, found->second.address,
215 found->second.address,
216 base::Bind(&LocalDiscoveryUIHandler::StartRegisterHTTP, 215 base::Bind(&LocalDiscoveryUIHandler::StartRegisterHTTP,
217 base::Unretained(this))); 216 base::Unretained(this)));
218 privet_resolution_->Start(); 217 privet_resolution_->Start();
219 } else { 218 } else {
220 OnSetupError(); 219 OnSetupError();
221 } 220 }
222 } 221 }
223 222
224 void LocalDiscoveryUIHandler::HandleCancelRegistration( 223 void LocalDiscoveryUIHandler::HandleCancelRegistration(
225 const base::ListValue* args) { 224 const base::ListValue* args) {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 640
642 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { 641 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() {
643 if (cloud_print_connector_ui_enabled_) 642 if (cloud_print_connector_ui_enabled_)
644 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> 643 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))->
645 RefreshStatusFromService(); 644 RefreshStatusFromService();
646 } 645 }
647 646
648 #endif // cloud print connector option stuff 647 #endif // cloud print connector option stuff
649 648
650 } // namespace local_discovery 649 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/privet_notifications.cc ('k') | chrome/browser/ui/webui/print_preview/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698