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 "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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 service_prefs_->RemovePref(prefs::kCloudPrintRoot); | 128 service_prefs_->RemovePref(prefs::kCloudPrintRoot); |
129 if (!proxy_id.empty()) { | 129 if (!proxy_id.empty()) { |
130 // Keep only proxy id; | 130 // Keep only proxy id; |
131 service_prefs_->SetString(prefs::kCloudPrintProxyId, proxy_id); | 131 service_prefs_->SetString(prefs::kCloudPrintProxyId, proxy_id); |
132 } | 132 } |
133 service_prefs_->SetBoolean(prefs::kCloudPrintConnectNewPrinters, | 133 service_prefs_->SetBoolean(prefs::kCloudPrintConnectNewPrinters, |
134 connect_new_printers); | 134 connect_new_printers); |
135 if (!printer_blacklist.empty()) { | 135 if (!printer_blacklist.empty()) { |
136 scoped_ptr<base::ListValue> printers(new base::ListValue()); | 136 scoped_ptr<base::ListValue> printers(new base::ListValue()); |
137 printers->AppendStrings(printer_blacklist); | 137 printers->AppendStrings(printer_blacklist); |
138 service_prefs_->SetValue(prefs::kCloudPrintConnectNewPrinters, | 138 service_prefs_->SetValue(prefs::kCloudPrintPrinterBlacklist, |
139 printers.release()); | 139 printers.release()); |
140 } | 140 } |
141 service_prefs_->WritePrefs(); | 141 service_prefs_->WritePrefs(); |
142 | 142 |
143 if (!CreateBackend()) | 143 if (!CreateBackend()) |
144 return; | 144 return; |
145 DCHECK(backend_.get()); | 145 DCHECK(backend_.get()); |
146 user_email_ = user_email; | 146 user_email_ = user_email; |
147 backend_->InitializeWithRobotAuthCode(robot_auth_code, robot_email); | 147 backend_->InitializeWithRobotAuthCode(robot_auth_code, robot_email); |
148 if (client_) { | 148 if (client_) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 void CloudPrintProxy::ShutdownBackend() { | 266 void CloudPrintProxy::ShutdownBackend() { |
267 DCHECK(CalledOnValidThread()); | 267 DCHECK(CalledOnValidThread()); |
268 if (backend_.get()) | 268 if (backend_.get()) |
269 backend_->Shutdown(); | 269 backend_->Shutdown(); |
270 backend_.reset(); | 270 backend_.reset(); |
271 } | 271 } |
272 | 272 |
273 } // namespace cloud_print | 273 } // namespace cloud_print |
OLD | NEW |