OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/password_manager/password_manager_util.h" | |
6 | |
7 #include "base/strings/string_util.h" | |
8 | |
9 namespace password_manager_util { | |
10 | |
11 bool IsDomainNameMonitored(const std::string& url_host, | |
12 std::string* domain_name) { | |
13 | |
14 const std::string kMonitoredDomainName[] = { | |
15 "google.com", | |
16 "yahoo.com", | |
17 "baidu.com", | |
18 "wikipedia.org", | |
19 "linkedin.com", | |
20 "twitter.com", | |
21 "live.com", | |
22 "amazon.com", | |
23 }; | |
24 const size_t kMonitoredDomainNameLength = arraysize(kMonitoredDomainName); | |
25 | |
26 domain_name->clear(); | |
27 | |
28 for (std::string::size_type i = 0; i < kMonitoredDomainNameLength; ++i) { | |
29 if (EndsWith(url_host, kMonitoredDomainName[i], true)) { | |
vabr (Chromium)
2013/08/28 15:49:45
Currently this would match "notreallygoogle.com" a
| |
30 *domain_name = kMonitoredDomainName[i]; | |
31 return true; | |
32 } | |
33 } | |
34 return false; | |
35 } | |
36 | |
37 } // namespace password_manager_util | |
OLD | NEW |