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

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

Issue 762723003: Prefix CommandLine usage with base namespace (Part 8: components) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/common/password_generation_util.h" 5 #include "components/autofill/core/common/password_generation_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "components/autofill/core/common/autofill_switches.h" 10 #include "components/autofill/core/common/autofill_switches.h"
(...skipping 30 matching lines...) Expand all
41 event, EVENT_ENUM_COUNT); 41 event, EVENT_ENUM_COUNT);
42 } 42 }
43 43
44 bool IsPasswordGenerationEnabled() { 44 bool IsPasswordGenerationEnabled() {
45 // Always fetch the field trial group to ensure it is reported correctly. 45 // Always fetch the field trial group to ensure it is reported correctly.
46 // The command line flags will be associated with a group that is reported 46 // The command line flags will be associated with a group that is reported
47 // so long as trial is actually queried. 47 // so long as trial is actually queried.
48 std::string group_name = 48 std::string group_name =
49 base::FieldTrialList::FindFullName("PasswordGeneration"); 49 base::FieldTrialList::FindFullName("PasswordGeneration");
50 50
51 CommandLine* command_line = CommandLine::ForCurrentProcess(); 51 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
52 if (command_line->HasSwitch(switches::kDisablePasswordGeneration)) 52 if (command_line->HasSwitch(switches::kDisablePasswordGeneration))
53 return false; 53 return false;
54 54
55 if (command_line->HasSwitch(switches::kEnablePasswordGeneration)) 55 if (command_line->HasSwitch(switches::kEnablePasswordGeneration))
56 return true; 56 return true;
57 57
58 return group_name != "Disabled"; 58 return group_name != "Disabled";
59 } 59 }
60 60
61 } // namespace password_generation 61 } // namespace password_generation
62 } // namespace autofill 62 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/form_structure_unittest.cc ('k') | components/cloud_devices/common/cloud_devices_urls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698