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

Unified Diff: cloud_print/service/win/chrome_launcher.cc

Issue 13771017: Restore proxy_id after generation new Service State file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/service/win/chrome_launcher.cc
diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc
index ecce60cc096ab701425ce47a38b7ea25bcacbaac..1d5395a677a44f4123fe6a2a79cff4a88528fd86 100644
--- a/cloud_print/service/win/chrome_launcher.cc
+++ b/cloud_print/service/win/chrome_launcher.cc
@@ -85,7 +85,8 @@ GURL GetCloudPrintServiceEnableURLWithSignin(const std::string& proxy_id) {
url, "continue", GetCloudPrintServiceEnableURL(proxy_id).spec());
}
-std::string UpdateServiceState(const std::string& json) {
+std::string UpdateServiceState(const std::string& json,
+ const std::string& proxy_id) {
std::string result;
scoped_ptr<base::Value> service_state(base::JSONReader::Read(json));
@@ -107,9 +108,10 @@ std::string UpdateServiceState(const std::string& json) {
dictionary->Set(prefs::kCloudPrintRoot, cloud_print_root);
dictionary->SetBoolean(prefs::kCloudPrintXmppPingEnabled, true);
-
- base::JSONWriter::Write(dictionary, &result);
-
+ dictionary->SetString(prefs::kCloudPrintProxyId, proxy_id);
+ base::JSONWriter::WriteWithOptions(dictionary,
+ base::JSONWriter::OPTIONS_PRETTY_PRINT,
+ &result);
return result;
}
@@ -302,6 +304,6 @@ std::string ChromeLauncher::CreateServiceStateFile(
return result;
}
- return UpdateServiceState(json);
+ return UpdateServiceState(json, proxy_id);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698