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

Unified Diff: chrome/browser/printing/cloud_print/privet_confirm_api_flow.cc

Issue 2742763002: Clean up Cloud Print API flow code. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « chrome/browser/printing/cloud_print/privet_confirm_api_flow.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/cloud_print/privet_confirm_api_flow.cc
diff --git a/chrome/browser/printing/cloud_print/privet_confirm_api_flow.cc b/chrome/browser/printing/cloud_print/privet_confirm_api_flow.cc
index 50fe1272256d968b5bb16d404428a1a402e6ad57..46811e5a59a620f5524ca5a25095dde14c9b1166 100644
--- a/chrome/browser/printing/cloud_print/privet_confirm_api_flow.cc
+++ b/chrome/browser/printing/cloud_print/privet_confirm_api_flow.cc
@@ -14,15 +14,6 @@
namespace cloud_print {
-namespace {
-
-GURL GetConfirmFlowUrl(const std::string& token) {
- return net::AppendQueryParameter(
- cloud_devices::GetCloudPrintRelativeURL("confirm"), "token", token);
-}
-
-} // namespace
-
PrivetConfirmApiCallFlow::PrivetConfirmApiCallFlow(
const std::string& token,
const ResponseCallback& callback)
@@ -39,17 +30,12 @@ void PrivetConfirmApiCallFlow::OnGCDApiFlowError(GCDApiFlow::Status status) {
void PrivetConfirmApiCallFlow::OnGCDApiFlowComplete(
const base::DictionaryValue& value) {
bool success = false;
-
if (!value.GetBoolean(cloud_print::kSuccessValue, &success)) {
callback_.Run(GCDApiFlow::ERROR_MALFORMED_RESPONSE);
return;
}
- if (success) {
- callback_.Run(GCDApiFlow::SUCCESS);
- } else {
- callback_.Run(GCDApiFlow::ERROR_FROM_SERVER);
- }
+ callback_.Run(success ? GCDApiFlow::SUCCESS : GCDApiFlow::ERROR_FROM_SERVER);
}
net::URLFetcher::RequestType PrivetConfirmApiCallFlow::GetRequestType() {
@@ -57,7 +43,8 @@ net::URLFetcher::RequestType PrivetConfirmApiCallFlow::GetRequestType() {
}
GURL PrivetConfirmApiCallFlow::GetURL() {
- return GetConfirmFlowUrl(token_);
+ return net::AppendQueryParameter(
+ cloud_devices::GetCloudPrintRelativeURL("confirm"), "token", token_);
}
} // namespace cloud_print
« no previous file with comments | « chrome/browser/printing/cloud_print/privet_confirm_api_flow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698