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

Side by Side Diff: components/proximity_auth/cryptauth/cryptauth_client.cc

Issue 818103002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « components/precache/core/precache_fetcher_unittest.cc ('k') | components/search/search.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h" 7 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h"
8 #include "components/proximity_auth/cryptauth/cryptauth_api_call_flow.h" 8 #include "components/proximity_auth/cryptauth/cryptauth_api_call_flow.h"
9 #include "components/proximity_auth/cryptauth/cryptauth_client.h" 9 #include "components/proximity_auth/cryptauth/cryptauth_client.h"
10 #include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h" 10 #include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h"
(...skipping 18 matching lines...) Expand all
29 const char kToggleEasyUnlockPath[] = "deviceSync/toggleeasyunlock"; 29 const char kToggleEasyUnlockPath[] = "deviceSync/toggleeasyunlock";
30 const char kSetupEnrollmentPath[] = "enrollment/setupenrollment"; 30 const char kSetupEnrollmentPath[] = "enrollment/setupenrollment";
31 const char kFinishEnrollmentPath[] = "enrollment/finishenrollment"; 31 const char kFinishEnrollmentPath[] = "enrollment/finishenrollment";
32 32
33 // Query string of the API URL indicating that the response should be in a 33 // Query string of the API URL indicating that the response should be in a
34 // serialized protobuf format. 34 // serialized protobuf format.
35 const char kQueryProtobuf[] = "?alt=proto"; 35 const char kQueryProtobuf[] = "?alt=proto";
36 36
37 // Creates the full CryptAuth URL for endpoint to the API with |request_path|. 37 // Creates the full CryptAuth URL for endpoint to the API with |request_path|.
38 GURL CreateRequestUrl(const std::string& request_path) { 38 GURL CreateRequestUrl(const std::string& request_path) {
39 CommandLine* command_line = CommandLine::ForCurrentProcess(); 39 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
40 GURL google_apis_url = 40 GURL google_apis_url =
41 GURL(command_line->HasSwitch(switches::kCryptAuthHTTPHost) 41 GURL(command_line->HasSwitch(switches::kCryptAuthHTTPHost)
42 ? command_line->GetSwitchValueASCII(switches::kCryptAuthHTTPHost) 42 ? command_line->GetSwitchValueASCII(switches::kCryptAuthHTTPHost)
43 : kDefaultCryptAuthHTTPHost); 43 : kDefaultCryptAuthHTTPHost);
44 return google_apis_url.Resolve(kCryptAuthPath + request_path + 44 return google_apis_url.Resolve(kCryptAuthPath + request_path +
45 kQueryProtobuf); 45 kQueryProtobuf);
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return; 160 return;
161 } 161 }
162 result_callback.Run(response); 162 result_callback.Run(response);
163 }; 163 };
164 164
165 void CryptAuthClient::OnApiCallFailed(const std::string& error_message) { 165 void CryptAuthClient::OnApiCallFailed(const std::string& error_message) {
166 error_callback_.Run(error_message); 166 error_callback_.Run(error_message);
167 } 167 }
168 168
169 } // proximity_auth 169 } // proximity_auth
OLDNEW
« no previous file with comments | « components/precache/core/precache_fetcher_unittest.cc ('k') | components/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698