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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 | 906 |
907 #if defined(OS_ANDROID) | 907 #if defined(OS_ANDROID) |
908 const FeatureEntry::FeatureParam kPersistentMenuItemEnabled[] = { | 908 const FeatureEntry::FeatureParam kPersistentMenuItemEnabled[] = { |
909 {"persistent_menu_item_enabled", "true"}}; | 909 {"persistent_menu_item_enabled", "true"}}; |
910 | 910 |
911 const FeatureEntry::FeatureVariation kDataReductionMainMenuFeatureVariations[] = | 911 const FeatureEntry::FeatureVariation kDataReductionMainMenuFeatureVariations[] = |
912 {{"(persistent)", kPersistentMenuItemEnabled, | 912 {{"(persistent)", kPersistentMenuItemEnabled, |
913 arraysize(kPersistentMenuItemEnabled), nullptr}}; | 913 arraysize(kPersistentMenuItemEnabled), nullptr}}; |
914 #endif // OS_ANDROID | 914 #endif // OS_ANDROID |
915 | 915 |
| 916 const FeatureEntry::Choice kEnableHeapProfilingChoices[] = { |
| 917 {flags_ui::kGenericExperimentChoiceDisabled, "", ""}, |
| 918 {flag_descriptions::kEnableHeapProfilingModePseudo, |
| 919 switches::kEnableHeapProfiling, switches::kEnableHeapProfilingModePseudo}, |
| 920 {flag_descriptions::kEnableHeapProfilingModeNative, |
| 921 switches::kEnableHeapProfiling, switches::kEnableHeapProfilingModeNative}, |
| 922 {flag_descriptions::kEnableHeapProfilingTaskProfiler, |
| 923 switches::kEnableHeapProfiling, |
| 924 switches::kEnableHeapProfilingTaskProfiler}}; |
| 925 |
916 // RECORDING USER METRICS FOR FLAGS: | 926 // RECORDING USER METRICS FOR FLAGS: |
917 // ----------------------------------------------------------------------------- | 927 // ----------------------------------------------------------------------------- |
918 // The first line of the entry is the internal name. | 928 // The first line of the entry is the internal name. |
919 // | 929 // |
920 // To add a new entry, add to the end of kFeatureEntries. There are two | 930 // To add a new entry, add to the end of kFeatureEntries. There are two |
921 // distinct types of entries: | 931 // distinct types of entries: |
922 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE | 932 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE |
923 // macro for this type supplying the command line to the macro. | 933 // macro for this type supplying the command line to the macro. |
924 // . MULTI_VALUE: a list of choices, the first of which should correspond to a | 934 // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
925 // deactivated state for this lab (i.e. no command line option). To specify | 935 // deactivated state for this lab (i.e. no command line option). To specify |
(...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2752 {"enable-clipboard-provider", | 2762 {"enable-clipboard-provider", |
2753 flag_descriptions::kEnableOmniboxClipboardProviderName, | 2763 flag_descriptions::kEnableOmniboxClipboardProviderName, |
2754 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, | 2764 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, |
2755 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, | 2765 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, |
2756 #endif | 2766 #endif |
2757 | 2767 |
2758 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, | 2768 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, |
2759 flag_descriptions::kAutoplayPolicyDescription, kOsAll, | 2769 flag_descriptions::kAutoplayPolicyDescription, kOsAll, |
2760 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, | 2770 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, |
2761 | 2771 |
| 2772 {"enable-heap-profiling", flag_descriptions::kEnableHeapProfilingName, |
| 2773 flag_descriptions::kEnableHeapProfilingDescription, kOsAll, |
| 2774 MULTI_VALUE_TYPE(kEnableHeapProfilingChoices)}, |
| 2775 |
2762 // NOTE: Adding new command-line switches requires adding corresponding | 2776 // NOTE: Adding new command-line switches requires adding corresponding |
2763 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2777 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2764 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2778 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2765 }; | 2779 }; |
2766 | 2780 |
2767 class FlagsStateSingleton { | 2781 class FlagsStateSingleton { |
2768 public: | 2782 public: |
2769 FlagsStateSingleton() | 2783 FlagsStateSingleton() |
2770 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2784 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
2771 ~FlagsStateSingleton() {} | 2785 ~FlagsStateSingleton() {} |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2977 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 2991 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
2978 | 2992 |
2979 const FeatureEntry* GetFeatureEntries(size_t* count) { | 2993 const FeatureEntry* GetFeatureEntries(size_t* count) { |
2980 *count = arraysize(kFeatureEntries); | 2994 *count = arraysize(kFeatureEntries); |
2981 return kFeatureEntries; | 2995 return kFeatureEntries; |
2982 } | 2996 } |
2983 | 2997 |
2984 } // namespace testing | 2998 } // namespace testing |
2985 | 2999 |
2986 } // namespace about_flags | 3000 } // namespace about_flags |
OLD | NEW |