OLD | NEW |
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 Loading... |
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 |
OLD | NEW |