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

Side by Side Diff: chrome/browser/service/service_process_control.cc

Issue 8403015: base::Bind: Convert ServiceProcessControl::CloudPrintProxyInfoHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/service/service_process_control.h" 5 #include "chrome/browser/service/service_process_control.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 const content::NotificationSource& source, 213 const content::NotificationSource& source,
214 const content::NotificationDetails& details) { 214 const content::NotificationDetails& details) {
215 if (type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED) { 215 if (type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED) {
216 Send(new ServiceMsg_UpdateAvailable); 216 Send(new ServiceMsg_UpdateAvailable);
217 } 217 }
218 } 218 }
219 219
220 void ServiceProcessControl::OnCloudPrintProxyInfo( 220 void ServiceProcessControl::OnCloudPrintProxyInfo(
221 const cloud_print::CloudPrintProxyInfo& proxy_info) { 221 const cloud_print::CloudPrintProxyInfo& proxy_info) {
222 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 222 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
223 if (cloud_print_info_callback_ != NULL) { 223 if (!cloud_print_info_callback_.is_null()) {
224 cloud_print_info_callback_->Run(proxy_info); 224 cloud_print_info_callback_.Run(proxy_info);
225 cloud_print_info_callback_.reset(); 225 cloud_print_info_callback_.Reset();
226 } 226 }
227 } 227 }
228 228
229 bool ServiceProcessControl::GetCloudPrintProxyInfo( 229 bool ServiceProcessControl::GetCloudPrintProxyInfo(
230 CloudPrintProxyInfoHandler* cloud_print_info_callback) { 230 const CloudPrintProxyInfoHandler& cloud_print_info_callback) {
231 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 231 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
232 DCHECK(cloud_print_info_callback); 232 DCHECK_EQ(false, cloud_print_info_callback.is_null());
233 cloud_print_info_callback_.reset(cloud_print_info_callback); 233
234 cloud_print_info_callback_ = cloud_print_info_callback;
234 return Send(new ServiceMsg_GetCloudPrintProxyInfo()); 235 return Send(new ServiceMsg_GetCloudPrintProxyInfo());
235 } 236 }
236 237
237 bool ServiceProcessControl::Shutdown() { 238 bool ServiceProcessControl::Shutdown() {
238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
239 bool ret = Send(new ServiceMsg_Shutdown()); 240 bool ret = Send(new ServiceMsg_Shutdown());
240 channel_.reset(); 241 channel_.reset();
241 return ret; 242 return ret;
242 } 243 }
243 244
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if (base::LaunchProcess(*cmd_line_, options, NULL)) { 304 if (base::LaunchProcess(*cmd_line_, options, NULL)) {
304 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 305 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
305 NewRunnableMethod(this, 306 NewRunnableMethod(this,
306 &Launcher::DoDetectLaunched)); 307 &Launcher::DoDetectLaunched));
307 } else { 308 } else {
308 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 309 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
309 NewRunnableMethod(this, &Launcher::Notify)); 310 NewRunnableMethod(this, &Launcher::Notify));
310 } 311 }
311 } 312 }
312 #endif // !OS_MACOSX 313 #endif // !OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/browser/service/service_process_control.h ('k') | chrome/browser/service/service_process_control_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698