| OLD | NEW |
| 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/service/cloud_print/cloud_print_proxy.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 print_system_settings, | 164 print_system_settings, |
| 165 oauth_client_info, | 165 oauth_client_info, |
| 166 enable_job_poll)); | 166 enable_job_poll)); |
| 167 return true; | 167 return true; |
| 168 } | 168 } |
| 169 | 169 |
| 170 void CloudPrintProxy::DisableForUser() { | 170 void CloudPrintProxy::DisableForUser() { |
| 171 DCHECK(CalledOnValidThread()); | 171 DCHECK(CalledOnValidThread()); |
| 172 user_email_.clear(); | 172 user_email_.clear(); |
| 173 enabled_ = false; | 173 enabled_ = false; |
| 174 Shutdown(); | |
| 175 if (client_) { | 174 if (client_) { |
| 176 client_->OnCloudPrintProxyDisabled(true); | 175 client_->OnCloudPrintProxyDisabled(true); |
| 177 } | 176 } |
| 177 Shutdown(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void CloudPrintProxy::GetProxyInfo(cloud_print::CloudPrintProxyInfo* info) { | 180 void CloudPrintProxy::GetProxyInfo(cloud_print::CloudPrintProxyInfo* info) { |
| 181 info->enabled = enabled_; | 181 info->enabled = enabled_; |
| 182 info->email.clear(); | 182 info->email.clear(); |
| 183 if (enabled_) | 183 if (enabled_) |
| 184 info->email = user_email(); | 184 info->email = user_email(); |
| 185 info->proxy_id = proxy_id_; | 185 info->proxy_id = proxy_id_; |
| 186 // If the Cloud Print service is not enabled, we may need to read the old | 186 // If the Cloud Print service is not enabled, we may need to read the old |
| 187 // value of proxy_id from prefs. | 187 // value of proxy_id from prefs. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 void CloudPrintProxy::Shutdown() { | 237 void CloudPrintProxy::Shutdown() { |
| 238 DCHECK(CalledOnValidThread()); | 238 DCHECK(CalledOnValidThread()); |
| 239 if (backend_.get()) | 239 if (backend_.get()) |
| 240 backend_->Shutdown(); | 240 backend_->Shutdown(); |
| 241 backend_.reset(); | 241 backend_.reset(); |
| 242 } | 242 } |
| 243 | 243 |
| OLD | NEW |