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

Side by Side Diff: chrome/browser/about_flags.cc

Issue 1965493002: Add runtime setting to force passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 7 months 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 (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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // so by default we want to avoid debugging that. 178 // so by default we want to avoid debugging that.
179 // NOTE: As the default value must be the empty string, the mask excluding 179 // NOTE: As the default value must be the empty string, the mask excluding
180 // the PNaCl translator and secure shell is substituted elsewhere. 180 // the PNaCl translator and secure shell is substituted elsewhere.
181 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" }, 181 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
182 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" }, 182 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
183 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG, 183 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
184 switches::kNaClDebugMask, "*://*/*debug.nmf" } 184 switches::kNaClDebugMask, "*://*/*debug.nmf" }
185 }; 185 };
186 #endif 186 #endif
187 187
188 const FeatureEntry::Choice kPassiveListenersChoices[] = {
189 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
190 {IDS_FLAGS_PASSIVE_EVENT_LISTENER_DOCUMENT_TRUE,
191 switches::kPassiveListenersDefault, "documentonlytrue"},
192 {IDS_FLAGS_PASSIVE_EVENT_LISTENER_TRUE, switches::kPassiveListenersDefault,
193 "true"},
194 {IDS_FLAGS_PASSIVE_EVENT_LISTENER_FORCE_ALL_TRUE,
195 switches::kPassiveListenersDefault, "forcealltrue"},
196 };
197
188 const FeatureEntry::Choice kMarkNonSecureAsChoices[] = { 198 const FeatureEntry::Choice kMarkNonSecureAsChoices[] = {
189 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""}, 199 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
190 {IDS_MARK_NON_SECURE_AS_NEUTRAL, security_state::switches::kMarkNonSecureAs, 200 {IDS_MARK_NON_SECURE_AS_NEUTRAL, security_state::switches::kMarkNonSecureAs,
191 security_state::switches::kMarkNonSecureAsNeutral}, 201 security_state::switches::kMarkNonSecureAsNeutral},
192 {IDS_MARK_NON_SECURE_AS_NON_SECURE, 202 {IDS_MARK_NON_SECURE_AS_NON_SECURE,
193 security_state::switches::kMarkNonSecureAs, 203 security_state::switches::kMarkNonSecureAs,
194 security_state::switches::kMarkNonSecureAsNonSecure}}; 204 security_state::switches::kMarkNonSecureAsNonSecure}};
195 205
196 const FeatureEntry::Choice kDataReductionProxyLoFiChoices[] = { 206 const FeatureEntry::Choice kDataReductionProxyLoFiChoices[] = {
197 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, 207 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 IDS_FLAGS_MEDIA_STYLE_NOTIFICATION_DESCRIPTION, kOsAndroid, 1871 IDS_FLAGS_MEDIA_STYLE_NOTIFICATION_DESCRIPTION, kOsAndroid,
1862 FEATURE_VALUE_TYPE(chrome::android::kMediaStyleNotification)}, 1872 FEATURE_VALUE_TYPE(chrome::android::kMediaStyleNotification)},
1863 {"important-sites-in-cbd", IDS_FLAGS_IMPORTANT_SITES_IN_CBD_NAME, 1873 {"important-sites-in-cbd", IDS_FLAGS_IMPORTANT_SITES_IN_CBD_NAME,
1864 IDS_FLAGS_IMPORTANT_SITES_IN_CBD_DESCRIPTION, kOsAndroid, 1874 IDS_FLAGS_IMPORTANT_SITES_IN_CBD_DESCRIPTION, kOsAndroid,
1865 FEATURE_VALUE_TYPE(chrome::android::kImportantSitesInCBD)}, 1875 FEATURE_VALUE_TYPE(chrome::android::kImportantSitesInCBD)},
1866 #endif 1876 #endif
1867 {"enable-pointer-events", // FLAGS:RECORD_UMA 1877 {"enable-pointer-events", // FLAGS:RECORD_UMA
1868 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_NAME, 1878 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_NAME,
1869 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_DESCRIPTION, kOsAll, 1879 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_DESCRIPTION, kOsAll,
1870 FEATURE_VALUE_TYPE(features::kPointerEvents)}, 1880 FEATURE_VALUE_TYPE(features::kPointerEvents)},
1881 {"passive-listener-default", // FLAGS:RECORD_UMA
1882 IDS_FLAGS_PASSIVE_EVENT_LISTENER_DEFAULT_NAME,
1883 IDS_FLAGS_PASSIVE_EVENT_LISTENER_DEFAULT_DESCRIPTION, kOsAll,
1884 MULTI_VALUE_TYPE(kPassiveListenersChoices)},
1885
1871 // NOTE: Adding new command-line switches requires adding corresponding 1886 // NOTE: Adding new command-line switches requires adding corresponding
1872 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 1887 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
1873 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 1888 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
1874 }; 1889 };
1875 1890
1876 class FlagsStateSingleton { 1891 class FlagsStateSingleton {
1877 public: 1892 public:
1878 FlagsStateSingleton() 1893 FlagsStateSingleton()
1879 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} 1894 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {}
1880 ~FlagsStateSingleton() {} 1895 ~FlagsStateSingleton() {}
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2075 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2061 2076
2062 const FeatureEntry* GetFeatureEntries(size_t* count) { 2077 const FeatureEntry* GetFeatureEntries(size_t* count) {
2063 *count = arraysize(kFeatureEntries); 2078 *count = arraysize(kFeatureEntries);
2064 return kFeatureEntries; 2079 return kFeatureEntries;
2065 } 2080 }
2066 2081
2067 } // namespace testing 2082 } // namespace testing
2068 2083
2069 } // namespace about_flags 2084 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698