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

Unified Diff: chrome/browser/password_manager/password_manager_util.cc

Issue 23140005: Added of new UMA signals in order to be able to discover early if the "save password" feature gets … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review 3 Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698