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

Side by Side Diff: components/autofill/core/common/password_autofill_util.cc

Issue 697233002: Remove flag to disable ignore autocomplete='off' for password forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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 "components/autofill/core/common/password_autofill_util.h"
6
7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h"
9 #include "components/autofill/core/common/autofill_switches.h"
10
11 namespace autofill {
12
13 namespace {
14
15 const char kDisableIgnoreAutocompleteOffFieldTrialName[] =
16 "DisableIgnoreAutocompleteOff";
17 const char kEnablingGroup[] = "ENABLED";
18
19 bool InDisableIgnoreAutocompleteOffGroup() {
20 std::string group_name = base::FieldTrialList::FindFullName(
21 kDisableIgnoreAutocompleteOffFieldTrialName);
22
23 return group_name.compare(kEnablingGroup) == 0;
24 }
25
26 } // namespace
27
28 // We ignore autocomplete='off' unless the user has specified the command line
29 // flag instructing otherwise or is in the field trial group specifying that
30 // ignore autocomplete='off' should be disabled.
31 bool ShouldIgnoreAutocompleteOffForPasswordFields() {
32 // TODO(jww): The field trial is scheduled to end 2014/9/1. At latest, we
33 // should remove the field trial and switch by then.
34 return !InDisableIgnoreAutocompleteOffGroup() &&
35 !CommandLine::ForCurrentProcess()->HasSwitch(
36 switches::kDisableIgnoreAutocompleteOff);
37 }
38
39 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698