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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 #include "device/base/features.h" | 78 #include "device/base/features.h" |
79 #include "device/vr/features/features.h" | 79 #include "device/vr/features/features.h" |
80 #include "extensions/features/features.h" | 80 #include "extensions/features/features.h" |
81 #include "gin/public/gin_features.h" | 81 #include "gin/public/gin_features.h" |
82 #include "gpu/config/gpu_switches.h" | 82 #include "gpu/config/gpu_switches.h" |
83 #include "media/audio/audio_features.h" | 83 #include "media/audio/audio_features.h" |
84 #include "media/base/media_switches.h" | 84 #include "media/base/media_switches.h" |
85 #include "media/media_features.h" | 85 #include "media/media_features.h" |
86 #include "media/midi/midi_switches.h" | 86 #include "media/midi/midi_switches.h" |
87 #include "net/cert/cert_verify_proc_android.h" | 87 #include "net/cert/cert_verify_proc_android.h" |
88 #include "net/nqe/effective_connection_type.h" | |
88 #include "ppapi/features/features.h" | 89 #include "ppapi/features/features.h" |
89 #include "printing/features/features.h" | 90 #include "printing/features/features.h" |
90 #include "services/device/public/cpp/device_features.h" | 91 #include "services/device/public/cpp/device_features.h" |
91 #include "ui/base/ui_base_switches.h" | 92 #include "ui/base/ui_base_switches.h" |
92 #include "ui/compositor/compositor_switches.h" | 93 #include "ui/compositor/compositor_switches.h" |
93 #include "ui/display/display_switches.h" | 94 #include "ui/display/display_switches.h" |
94 #include "ui/events/event_switches.h" | 95 #include "ui/events/event_switches.h" |
95 #include "ui/gfx/switches.h" | 96 #include "ui/gfx/switches.h" |
96 #include "ui/gl/gl_features.h" | 97 #include "ui/gl/gl_features.h" |
97 #include "ui/gl/gl_switches.h" | 98 #include "ui/gl/gl_switches.h" |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
714 #if defined(OS_ANDROID) | 715 #if defined(OS_ANDROID) |
715 {flag_descriptions::kAutoplayPolicyUserGestureRequired, | 716 {flag_descriptions::kAutoplayPolicyUserGestureRequired, |
716 switches::kAutoplayPolicy, switches::autoplay::kUserGestureRequiredPolicy}, | 717 switches::kAutoplayPolicy, switches::autoplay::kUserGestureRequiredPolicy}, |
717 #else | 718 #else |
718 {flag_descriptions::kAutoplayPolicyCrossOriginUserGestureRequired, | 719 {flag_descriptions::kAutoplayPolicyCrossOriginUserGestureRequired, |
719 switches::kAutoplayPolicy, | 720 switches::kAutoplayPolicy, |
720 switches::autoplay::kCrossOriginUserGestureRequiredPolicy}, | 721 switches::autoplay::kCrossOriginUserGestureRequiredPolicy}, |
721 #endif | 722 #endif |
722 }; | 723 }; |
723 | 724 |
725 const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = { | |
726 {flags_ui::kGenericExperimentChoiceDefault, "", ""}, | |
727 {flag_descriptions::kEffectiveConnectionTypeUnknownDescription, | |
728 switches::kForceEffectiveConnectionType, | |
729 net::kEffectiveConnectionTypeUnknown}, | |
730 {flag_descriptions::kEffectiveConnectionTypeOfflineDescription, | |
731 switches::kForceEffectiveConnectionType, | |
732 net::kEffectiveConnectionTypeOffline}, | |
733 {flag_descriptions::kEffectiveConnectionTypeSlow2GDescription, | |
734 switches::kForceEffectiveConnectionType, | |
735 net::kEffectiveConnectionTypeSlow2G}, | |
736 {flag_descriptions::kEffectiveConnectionType2GDescription, | |
737 switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType2G}, | |
738 {flag_descriptions::kEffectiveConnectionType3GDescription, | |
739 switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType3G}, | |
740 {flag_descriptions::kEffectiveConnectionType4GDescription, | |
741 switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType4G}, | |
742 }; | |
743 | |
744 // Ensure that all effective connection types returned by Network Quality | |
RyanSturm
2017/05/01 23:08:34
Maybe add a static_assert to make sure kForceEffec
tbansal1
2017/05/02 00:01:50
Done.
| |
745 // Estimator (NQE) are also exposed via flags. | |
746 static_assert(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN == 0, | |
747 "ECT enum value is not handled."); | |
748 static_assert(net::EFFECTIVE_CONNECTION_TYPE_4G + 1 == | |
749 net::EFFECTIVE_CONNECTION_TYPE_LAST, | |
750 "ECT enum value is not handled."); | |
751 | |
724 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = { | 752 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = { |
725 {prerender::kNoStatePrefetchFeatureModeParameterName, | 753 {prerender::kNoStatePrefetchFeatureModeParameterName, |
726 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}}; | 754 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}}; |
727 | 755 |
728 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = { | 756 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = { |
729 {prerender::kNoStatePrefetchFeatureModeParameterName, | 757 {prerender::kNoStatePrefetchFeatureModeParameterName, |
730 prerender::kNoStatePrefetchFeatureModeParameterPrerender}}; | 758 prerender::kNoStatePrefetchFeatureModeParameterPrerender}}; |
731 | 759 |
732 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = { | 760 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = { |
733 {prerender::kNoStatePrefetchFeatureModeParameterName, | 761 {prerender::kNoStatePrefetchFeatureModeParameterName, |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2758 {"enable-clipboard-provider", | 2786 {"enable-clipboard-provider", |
2759 flag_descriptions::kEnableOmniboxClipboardProviderName, | 2787 flag_descriptions::kEnableOmniboxClipboardProviderName, |
2760 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, | 2788 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, |
2761 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, | 2789 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, |
2762 #endif | 2790 #endif |
2763 | 2791 |
2764 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, | 2792 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, |
2765 flag_descriptions::kAutoplayPolicyDescription, kOsAll, | 2793 flag_descriptions::kAutoplayPolicyDescription, kOsAll, |
2766 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, | 2794 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, |
2767 | 2795 |
2796 {"force-effective-connection-type", | |
2797 flag_descriptions::kForceEffectiveConnectionTypeName, | |
2798 flag_descriptions::kForceEffectiveConnectionTypeDescription, kOsAll, | |
2799 MULTI_VALUE_TYPE(kForceEffectiveConnectionTypeChoices)}, | |
2800 | |
2768 // NOTE: Adding new command-line switches requires adding corresponding | 2801 // NOTE: Adding new command-line switches requires adding corresponding |
2769 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2802 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2770 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2803 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2771 }; | 2804 }; |
2772 | 2805 |
2773 class FlagsStateSingleton { | 2806 class FlagsStateSingleton { |
2774 public: | 2807 public: |
2775 FlagsStateSingleton() | 2808 FlagsStateSingleton() |
2776 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2809 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
2777 ~FlagsStateSingleton() {} | 2810 ~FlagsStateSingleton() {} |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2983 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 3016 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
2984 | 3017 |
2985 const FeatureEntry* GetFeatureEntries(size_t* count) { | 3018 const FeatureEntry* GetFeatureEntries(size_t* count) { |
2986 *count = arraysize(kFeatureEntries); | 3019 *count = arraysize(kFeatureEntries); |
2987 return kFeatureEntries; | 3020 return kFeatureEntries; |
2988 } | 3021 } |
2989 | 3022 |
2990 } // namespace testing | 3023 } // namespace testing |
2991 | 3024 |
2992 } // namespace about_flags | 3025 } // namespace about_flags |
OLD | NEW |