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

Unified Diff: chrome/common/cloud_print/cloud_print_helpers.cc

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 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/common/cloud_print/cloud_print_helpers.cc
diff --git a/chrome/common/cloud_print/cloud_print_helpers.cc b/chrome/common/cloud_print/cloud_print_helpers.cc
index 84e43201a039e1b1eb41c08958415a528d495550..28096c840f484772ab4f910a5de2a8e423f8cafc 100644
--- a/chrome/common/cloud_print/cloud_print_helpers.cc
+++ b/chrome/common/cloud_print/cloud_print_helpers.cc
@@ -76,7 +76,7 @@ GURL GetUrlForPrinterList(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "list"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf("proxy=%s", proxy_id.c_str());
+ std::string query = base::StringPrintf("proxy=%s", proxy_id.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
}
@@ -93,7 +93,7 @@ GURL GetUrlForPrinterUpdate(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "update"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf("printerid=%s", printer_id.c_str());
+ std::string query = base::StringPrintf("printerid=%s", printer_id.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
}
@@ -104,7 +104,7 @@ GURL GetUrlForPrinterDelete(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "delete"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf(
+ std::string query = base::StringPrintf(
"printerid=%s&reason=%s", printer_id.c_str(), reason.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
@@ -116,7 +116,7 @@ GURL GetUrlForJobFetch(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "fetch"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf(
+ std::string query = base::StringPrintf(
"printerid=%s&deb=%s", printer_id.c_str(), reason.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
@@ -128,7 +128,7 @@ GURL GetUrlForJobDelete(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "deletejob"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf("jobid=%s", job_id.c_str());
+ std::string query = base::StringPrintf("jobid=%s", job_id.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
}
@@ -139,7 +139,7 @@ GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "control"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf(
+ std::string query = base::StringPrintf(
"jobid=%s&status=%s", job_id.c_str(), status_string.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
@@ -150,7 +150,7 @@ GURL GetUrlForUserMessage(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "message"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf("code=%s", message_id.c_str());
+ std::string query = base::StringPrintf("code=%s", message_id.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
}
@@ -163,9 +163,9 @@ GURL GetUrlForGetAuthCode(const GURL& cloud_print_server_url,
std::string path(AppendPathToUrl(cloud_print_server_url, "createrobot"));
GURL::Replacements replacements;
replacements.SetPathStr(path);
- std::string query = StringPrintf("oauth_client_id=%s&proxy=%s",
- oauth_client_id.c_str(),
- proxy_id.c_str());
+ std::string query = base::StringPrintf("oauth_client_id=%s&proxy=%s",
+ oauth_client_id.c_str(),
+ proxy_id.c_str());
replacements.SetQueryStr(query);
return cloud_print_server_url.ReplaceComponents(replacements);
}
@@ -197,15 +197,15 @@ void AddMultipartValueForUpload(const std::string& value_name,
// First line is the boundary
post_data->append("--" + mime_boundary + "\r\n");
// Next line is the Content-disposition
- post_data->append(StringPrintf("Content-Disposition: form-data; "
+ post_data->append(base::StringPrintf("Content-Disposition: form-data; "
"name=\"%s\"\r\n", value_name.c_str()));
if (!content_type.empty()) {
// If Content-type is specified, the next line is that
- post_data->append(StringPrintf("Content-Type: %s\r\n",
+ post_data->append(base::StringPrintf("Content-Type: %s\r\n",
content_type.c_str()));
}
// Leave an empty line and append the value.
- post_data->append(StringPrintf("\r\n%s\r\n", value.c_str()));
+ post_data->append(base::StringPrintf("\r\n%s\r\n", value.c_str()));
}
std::string GetMultipartMimeType(const std::string& mime_boundary) {
@@ -239,12 +239,12 @@ std::string GetPostDataForPrinterTags(
NOTREACHED();
}
// All our tags have a special prefix to identify them as such.
- std::string msg = StringPrintf("%s%s=%s",
+ std::string msg = base::StringPrintf("%s%s=%s",
proxy_tag_prefix.c_str(), it->first.c_str(), it->second.c_str());
AddMultipartValueForUpload(kPrinterTagValue, msg, mime_boundary,
std::string(), &post_data);
}
- std::string tags_hash_msg = StringPrintf("%s=%s",
+ std::string tags_hash_msg = base::StringPrintf("%s=%s",
tags_hash_tag_name.c_str(),
HashPrinterTags(printer_tags_prepared).c_str());
AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg, mime_boundary,
@@ -253,7 +253,7 @@ std::string GetPostDataForPrinterTags(
}
std::string GetCloudPrintAuthHeader(const std::string& auth_token) {
- return StringPrintf("Authorization: OAuth %s", auth_token.c_str());
+ return base::StringPrintf("Authorization: OAuth %s", auth_token.c_str());
}
} // namespace cloud_print

Powered by Google App Engine
This is Rietveld 408576698