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

Unified Diff: chrome/service/cloud_print/cloud_print_proxy.cc

Issue 11037005: New Cloud Print Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
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 b6eff898a76a15ddf87f3f65b68f42a788548980..bfc03ac7cff38e824f2ae7a5775c351a52842d0b 100644
--- a/chrome/service/cloud_print/cloud_print_proxy.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy.cc
@@ -122,8 +122,23 @@ 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();
+ service_prefs_->SetBoolean(prefs::kCloudPrintConnectNewPrinters,
+ connect_new_printers);
+ service_prefs_->RemovePref(prefs::kCloudPrintPrinterBlacklist);
+ 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());

Powered by Google App Engine
This is Rietveld 408576698