Index: chrome/browser/password_manager/password_manager_util.cc |
diff --git a/chrome/browser/password_manager/password_manager_util.cc b/chrome/browser/password_manager/password_manager_util.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..48272cb068b7fd5a49d2d6f94031aa0a3c64d7c9 |
--- /dev/null |
+++ b/chrome/browser/password_manager/password_manager_util.cc |
@@ -0,0 +1,37 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/password_manager/password_manager_util.h" |
+ |
+#include "base/strings/string_util.h" |
+ |
+namespace password_manager_util { |
+ |
+bool IsDomainNameMonitored(const std::string& url_host, |
+ std::string* domain_name) { |
+ |
+ const std::string kMonitoredDomainName[] = { |
+ "google.com", |
+ "yahoo.com", |
+ "baidu.com", |
+ "wikipedia.org", |
+ "linkedin.com", |
+ "twitter.com", |
+ "live.com", |
+ "amazon.com", |
+ }; |
+ const size_t kMonitoredDomainNameLength = arraysize(kMonitoredDomainName); |
+ |
+ domain_name->clear(); |
+ |
+ for (std::string::size_type i = 0; i < kMonitoredDomainNameLength; ++i) { |
+ if (EndsWith(url_host, kMonitoredDomainName[i], true)) { |
vabr (Chromium)
2013/08/28 15:49:45
Currently this would match "notreallygoogle.com" a
|
+ *domain_name = kMonitoredDomainName[i]; |
+ return true; |
+ } |
+ } |
+ return false; |
+} |
+ |
+} // namespace password_manager_util |