| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 | 920 |
| 921 #if defined(OS_ANDROID) | 921 #if defined(OS_ANDROID) |
| 922 const FeatureEntry::FeatureParam kPersistentMenuItemEnabled[] = { | 922 const FeatureEntry::FeatureParam kPersistentMenuItemEnabled[] = { |
| 923 {"persistent_menu_item_enabled", "true"}}; | 923 {"persistent_menu_item_enabled", "true"}}; |
| 924 | 924 |
| 925 const FeatureEntry::FeatureVariation kDataReductionMainMenuFeatureVariations[] = | 925 const FeatureEntry::FeatureVariation kDataReductionMainMenuFeatureVariations[] = |
| 926 {{"(persistent)", kPersistentMenuItemEnabled, | 926 {{"(persistent)", kPersistentMenuItemEnabled, |
| 927 arraysize(kPersistentMenuItemEnabled), nullptr}}; | 927 arraysize(kPersistentMenuItemEnabled), nullptr}}; |
| 928 #endif // OS_ANDROID | 928 #endif // OS_ANDROID |
| 929 | 929 |
| 930 const FeatureEntry::Choice kEnableHeapProfilingChoices[] = { |
| 931 {flags_ui::kGenericExperimentChoiceDisabled, "", ""}, |
| 932 {flag_descriptions::kEnableHeapProfilingModePseudo, |
| 933 switches::kEnableHeapProfiling, switches::kEnableHeapProfilingModePseudo}, |
| 934 {flag_descriptions::kEnableHeapProfilingModeNative, |
| 935 switches::kEnableHeapProfiling, switches::kEnableHeapProfilingModeNative}, |
| 936 {flag_descriptions::kEnableHeapProfilingTaskProfiler, |
| 937 switches::kEnableHeapProfiling, |
| 938 switches::kEnableHeapProfilingTaskProfiler}}; |
| 939 |
| 930 // RECORDING USER METRICS FOR FLAGS: | 940 // RECORDING USER METRICS FOR FLAGS: |
| 931 // ----------------------------------------------------------------------------- | 941 // ----------------------------------------------------------------------------- |
| 932 // The first line of the entry is the internal name. | 942 // The first line of the entry is the internal name. |
| 933 // | 943 // |
| 934 // To add a new entry, add to the end of kFeatureEntries. There are two | 944 // To add a new entry, add to the end of kFeatureEntries. There are two |
| 935 // distinct types of entries: | 945 // distinct types of entries: |
| 936 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE | 946 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE |
| 937 // macro for this type supplying the command line to the macro. | 947 // macro for this type supplying the command line to the macro. |
| 938 // . MULTI_VALUE: a list of choices, the first of which should correspond to a | 948 // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 939 // deactivated state for this lab (i.e. no command line option). To specify | 949 // deactivated state for this lab (i.e. no command line option). To specify |
| (...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 {"enable-clipboard-provider", | 2771 {"enable-clipboard-provider", |
| 2762 flag_descriptions::kEnableOmniboxClipboardProviderName, | 2772 flag_descriptions::kEnableOmniboxClipboardProviderName, |
| 2763 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, | 2773 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, |
| 2764 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, | 2774 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, |
| 2765 #endif | 2775 #endif |
| 2766 | 2776 |
| 2767 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, | 2777 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, |
| 2768 flag_descriptions::kAutoplayPolicyDescription, kOsAll, | 2778 flag_descriptions::kAutoplayPolicyDescription, kOsAll, |
| 2769 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, | 2779 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, |
| 2770 | 2780 |
| 2781 {"enable-heap-profiling", flag_descriptions::kEnableHeapProfilingName, |
| 2782 flag_descriptions::kEnableHeapProfilingDescription, kOsAll, |
| 2783 MULTI_VALUE_TYPE(kEnableHeapProfilingChoices)}, |
| 2784 |
| 2771 // NOTE: Adding new command-line switches requires adding corresponding | 2785 // NOTE: Adding new command-line switches requires adding corresponding |
| 2772 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2786 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
| 2773 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2787 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
| 2774 }; | 2788 }; |
| 2775 | 2789 |
| 2776 class FlagsStateSingleton { | 2790 class FlagsStateSingleton { |
| 2777 public: | 2791 public: |
| 2778 FlagsStateSingleton() | 2792 FlagsStateSingleton() |
| 2779 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2793 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
| 2780 ~FlagsStateSingleton() {} | 2794 ~FlagsStateSingleton() {} |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2986 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 3000 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
| 2987 | 3001 |
| 2988 const FeatureEntry* GetFeatureEntries(size_t* count) { | 3002 const FeatureEntry* GetFeatureEntries(size_t* count) { |
| 2989 *count = arraysize(kFeatureEntries); | 3003 *count = arraysize(kFeatureEntries); |
| 2990 return kFeatureEntries; | 3004 return kFeatureEntries; |
| 2991 } | 3005 } |
| 2992 | 3006 |
| 2993 } // namespace testing | 3007 } // namespace testing |
| 2994 | 3008 |
| 2995 } // namespace about_flags | 3009 } // namespace about_flags |
| OLD | NEW |