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

Side by Side Diff: components/autofill/content/browser/wallet/wallet_service_url.cc

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/autofill/content/browser/wallet/wallet_service_url.h" 5 #include "components/autofill/content/browser/wallet/wallet_service_url.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 base::StringToSizeT(query_str.substr(value.begin, value.len), user_index); 199 base::StringToSizeT(query_str.substr(value.begin, value.len), user_index);
200 break; 200 break;
201 } 201 }
202 } 202 }
203 203
204 return true; 204 return true;
205 } 205 }
206 206
207 bool IsSignInRelatedUrl(const GURL& url) { 207 bool IsSignInRelatedUrl(const GURL& url) {
208 size_t unused; 208 size_t unused;
209 return url.GetOrigin() == GetAddAccountUrl().GetOrigin() || 209 // Origins are host names which are canonicalized, so case-sensitive is OK.
210 base::StartsWith(base::UTF8ToUTF16(url.GetOrigin().host()), 210 GURL origin = url.GetOrigin();
211 base::ASCIIToUTF16("accounts."), false) || 211 return origin == GetAddAccountUrl().GetOrigin() ||
212 base::StartsWith(origin.host(), "accounts.",
213 base::CompareCase::SENSITIVE) ||
212 IsSignInContinueUrl(url, &unused); 214 IsSignInContinueUrl(url, &unused);
213 } 215 }
214 216
215 bool IsUsingProd() { 217 bool IsUsingProd() {
216 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); 218 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl);
217 } 219 }
218 220
219 } // namespace wallet 221 } // namespace wallet
220 } // namespace autofill 222 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util_unittest.cc ('k') | components/autofill/content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698