Index: chrome/service/cloud_print/cloud_print_proxy.cc |
diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc |
index c934fbea824b38b940990ff92e0d2a256b923aaa..d1c8cb825219df79b63a45e7f62079b34396939c 100644 |
--- a/chrome/service/cloud_print/cloud_print_proxy.cc |
+++ b/chrome/service/cloud_print/cloud_print_proxy.cc |
@@ -122,8 +122,29 @@ void CloudPrintProxy::EnableForUser(const std::string& lsid) { |
void CloudPrintProxy::EnableForUserWithRobot( |
const std::string& robot_auth_code, |
const std::string& robot_email, |
- const std::string& user_email) { |
+ const std::string& user_email, |
+ bool connect_new_printers, |
+ const std::vector<std::string>& printer_blacklist) { |
DCHECK(CalledOnValidThread()); |
+ |
+ ShutdownBackend(); |
+ std::string proxy_id( |
+ service_prefs_->GetString(prefs::kCloudPrintProxyId, "")); |
+ service_prefs_->RemovePref(prefs::kCloudPrintRoot); |
+ if (!proxy_id.empty()) { |
+ // Keep only proxy id; |
+ service_prefs_->SetString(prefs::kCloudPrintProxyId, proxy_id); |
+ } |
+ service_prefs_->SetBoolean(prefs::kCloudPrintConnectNewPrinters, |
+ connect_new_printers); |
+ if (!printer_blacklist.empty()) { |
+ scoped_ptr<base::ListValue> printers(new base::ListValue()); |
+ printers->AppendStrings(printer_blacklist); |
+ service_prefs_->SetValue(prefs::kCloudPrintConnectNewPrinters, |
+ printers.release()); |
+ } |
+ service_prefs_->WritePrefs(); |
+ |
if (!CreateBackend()) |
return; |
DCHECK(backend_.get()); |