OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |