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

Side by Side Diff: chrome/service/cloud_print/cloud_print_proxy.cc

Issue 1900033005: Simplify some CloudPrintProxy code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/service/cloud_print/cloud_print_proxy.h" 5 #include "chrome/service/cloud_print/cloud_print_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return true; 126 return true;
127 } 127 }
128 128
129 void CloudPrintProxy::UnregisterPrintersAndDisableForUser() { 129 void CloudPrintProxy::UnregisterPrintersAndDisableForUser() {
130 DCHECK(CalledOnValidThread()); 130 DCHECK(CalledOnValidThread());
131 if (backend_.get()) { 131 if (backend_.get()) {
132 // Try getting auth and printers info from the backend. 132 // Try getting auth and printers info from the backend.
133 // We'll get notified in this case. 133 // We'll get notified in this case.
134 backend_->UnregisterPrinters(); 134 backend_->UnregisterPrinters();
135 } else { 135 } else {
136 // If no backend avaialble, disable connector immidiately. 136 // If no backend available, disable connector immediately.
137 DisableForUser(); 137 DisableForUser();
138 } 138 }
139 } 139 }
140 140
141 void CloudPrintProxy::DisableForUser() { 141 void CloudPrintProxy::DisableForUser() {
142 DCHECK(CalledOnValidThread()); 142 DCHECK(CalledOnValidThread());
143 user_email_.clear(); 143 user_email_.clear();
144 enabled_ = false; 144 enabled_ = false;
145 if (client_) { 145 if (client_) {
146 client_->OnCloudPrintProxyDisabled(true); 146 client_->OnCloudPrintProxyDisabled(true);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 void CloudPrintProxy::ShutdownBackend() { 247 void CloudPrintProxy::ShutdownBackend() {
248 DCHECK(CalledOnValidThread()); 248 DCHECK(CalledOnValidThread());
249 if (backend_.get()) 249 if (backend_.get())
250 backend_->Shutdown(); 250 backend_->Shutdown();
251 backend_.reset(); 251 backend_.reset();
252 } 252 }
253 253
254 } // namespace cloud_print 254 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signin/oauth2_login_manager.h ('k') | chrome/service/cloud_print/cloud_print_proxy_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698