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

Side by Side Diff: chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc

Issue 599463002: Use base::StringPairs where appropriate from src/chrome/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h" 5 #include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 web_flow_.release()->DetachDelegateAndDelete(); 164 web_flow_.release()->DetachDelegateAndDelete();
165 165
166 std::string fragment = url.GetContent().substr( 166 std::string fragment = url.GetContent().substr(
167 redirect_path_prefix_.length(), std::string::npos); 167 redirect_path_prefix_.length(), std::string::npos);
168 base::StringPairs pairs; 168 base::StringPairs pairs;
169 base::SplitStringIntoKeyValuePairs(fragment, '=', '&', &pairs); 169 base::SplitStringIntoKeyValuePairs(fragment, '=', '&', &pairs);
170 std::string access_token; 170 std::string access_token;
171 std::string error; 171 std::string error;
172 std::string expiration; 172 std::string expiration;
173 173
174 for (std::vector<std::pair<std::string, std::string> >::iterator 174 for (base::StringPairs::iterator
175 it = pairs.begin(); 175 it = pairs.begin();
Lei Zhang 2014/09/23 17:22:41 this now fits on the previous line
Anand Ratn (left samsung) 2014/09/24 03:50:53 Done.
176 it != pairs.end(); 176 it != pairs.end();
177 ++it) { 177 ++it) {
178 if (it->first == kOAuth2RedirectAccessTokenKey) 178 if (it->first == kOAuth2RedirectAccessTokenKey)
179 access_token = it->second; 179 access_token = it->second;
180 else if (it->first == kOAuth2RedirectErrorKey) 180 else if (it->first == kOAuth2RedirectErrorKey)
181 error = it->second; 181 error = it->second;
182 else if (it->first == kOAuth2ExpiresInKey) 182 else if (it->first == kOAuth2ExpiresInKey)
183 expiration = it->second; 183 expiration = it->second;
184 } 184 }
185 185
(...skipping 27 matching lines...) Expand all
213 } 213 }
214 214
215 scoped_ptr<WebAuthFlow> GaiaWebAuthFlow::CreateWebAuthFlow(GURL url) { 215 scoped_ptr<WebAuthFlow> GaiaWebAuthFlow::CreateWebAuthFlow(GURL url) {
216 return scoped_ptr<WebAuthFlow>(new WebAuthFlow(this, 216 return scoped_ptr<WebAuthFlow>(new WebAuthFlow(this,
217 profile_, 217 profile_,
218 url, 218 url,
219 WebAuthFlow::INTERACTIVE)); 219 WebAuthFlow::INTERACTIVE));
220 } 220 }
221 221
222 } // namespace extensions 222 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698