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

Side by Side 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 4 bis (Base files missing error in the previous one) Created 7 years, 3 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
(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 const char *kMonitoredDomainName[] = {
Ilya Sherman 2013/08/29 06:42:21 nit: "char*" (swap the position of the asterisk an
jdomingos 2013/08/30 21:09:20 Done.
14 "google.com",
15 "yahoo.com",
16 "baidu.com",
17 "wikipedia.org",
18 "linkedin.com",
19 "twitter.com",
20 "live.com",
21 "amazon.com",
22 };
Ilya Sherman 2013/08/29 06:42:21 Oof, this seems really questionable from a privacy
vabr (Chromium) 2013/08/29 08:15:13 I can confirm that somebody other than me will be
Ilya Sherman 2013/08/29 22:42:43 I'm not comfortable approving this change prior to
23 const size_t kMonitoredDomainNameLength = arraysize(kMonitoredDomainName);
24
25 domain_name->clear();
26
27 for (std::string::size_type i = 0; i < kMonitoredDomainNameLength; ++i) {
Ilya Sherman 2013/08/29 06:42:21 nit: You can just use size_t rather than std::stri
jdomingos 2013/08/30 21:09:20 Done.
28 size_t point_position =
29 url_host.size() - strlen(kMonitoredDomainName[i]) - 1;
30
31 if (url_host == kMonitoredDomainName[i] ||
32 (EndsWith(url_host, kMonitoredDomainName[i], true) &&
33 url_host[point_position] == '.')) {
Ilya Sherman 2013/08/29 06:42:21 Please use the GURL and url_parse::Parsed classes
jdomingos 2013/08/30 21:09:20 I don't understand what you want me to do here. Co
34 *domain_name = kMonitoredDomainName[i];
35 return true;
36 }
37 }
38 return false;
39 }
40
41 } // namespace password_manager_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698