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

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

Issue 2041783002: Preset variation parameters for NTPSnippets feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about-flags-parameters
Patch Set: After code review Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 #include "components/browser_sync/common/browser_sync_switches.h" 37 #include "components/browser_sync/common/browser_sync_switches.h"
38 #include "components/cloud_devices/common/cloud_devices_switches.h" 38 #include "components/cloud_devices/common/cloud_devices_switches.h"
39 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" 39 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h"
40 #include "components/dom_distiller/core/dom_distiller_switches.h" 40 #include "components/dom_distiller/core/dom_distiller_switches.h"
41 #include "components/error_page/common/error_page_switches.h" 41 #include "components/error_page/common/error_page_switches.h"
42 #include "components/flags_ui/feature_entry_macros.h" 42 #include "components/flags_ui/feature_entry_macros.h"
43 #include "components/flags_ui/flags_storage.h" 43 #include "components/flags_ui/flags_storage.h"
44 #include "components/flags_ui/flags_ui_switches.h" 44 #include "components/flags_ui/flags_ui_switches.h"
45 #include "components/nacl/common/nacl_switches.h" 45 #include "components/nacl/common/nacl_switches.h"
46 #include "components/network_session_configurator/switches.h" 46 #include "components/network_session_configurator/switches.h"
47 #include "components/ntp_snippets/ntp_snippets_constants.h"
47 #include "components/ntp_tiles/switches.h" 48 #include "components/ntp_tiles/switches.h"
48 #include "components/offline_pages/offline_page_feature.h" 49 #include "components/offline_pages/offline_page_feature.h"
49 #include "components/omnibox/browser/omnibox_switches.h" 50 #include "components/omnibox/browser/omnibox_switches.h"
50 #include "components/password_manager/core/common/password_manager_features.h" 51 #include "components/password_manager/core/common/password_manager_features.h"
51 #include "components/proximity_auth/switches.h" 52 #include "components/proximity_auth/switches.h"
52 #include "components/search/search_switches.h" 53 #include "components/search/search_switches.h"
53 #include "components/security_state/switches.h" 54 #include "components/security_state/switches.h"
54 #include "components/signin/core/common/signin_switches.h" 55 #include "components/signin/core/common/signin_switches.h"
55 #include "components/sync_driver/sync_driver_switches.h" 56 #include "components/sync_driver/sync_driver_switches.h"
56 #include "components/tracing/common/tracing_switches.h" 57 #include "components/tracing/common/tracing_switches.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kNtpSwitchToExistingTab, 506 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kNtpSwitchToExistingTab,
506 "disabled"}, 507 "disabled"},
507 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_URL, 508 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_URL,
508 switches::kNtpSwitchToExistingTab, "url"}, 509 switches::kNtpSwitchToExistingTab, "url"},
509 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_HOST, 510 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_HOST,
510 switches::kNtpSwitchToExistingTab, "host"}, 511 switches::kNtpSwitchToExistingTab, "host"},
511 }; 512 };
512 #endif // defined(OS_ANDROID) 513 #endif // defined(OS_ANDROID)
513 514
514 #if defined(OS_ANDROID) 515 #if defined(OS_ANDROID)
516 const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationDefault[] = {
517 {"fetching_personalization", "both"},
518 {"fetching_host_restrict", "off"},
Marc Treib 2016/06/17 13:43:54 Hm, the "Default" variant should probably not list
jkrcal 2016/06/17 14:13:43 Good point, done. (I had actually to change the de
519 };
520 const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationOnlyPersonal[] = {
521 {"fetching_personalization", "personal"},
522 {"fetching_host_restrict", "off"},
523 };
524 const FeatureEntry::FeatureParam
525 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted[] = {
526 {"fetching_personalization", "non_personal"},
527 {"fetching_host_restrict", "on"},
528 };
529 const FeatureEntry::FeatureParam
530 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted[] = {
531 {"fetching_personalization", "personal"},
532 {"fetching_host_restrict", "on"},
533 };
534
535 const FeatureEntry::FeatureVariation kNTPSnippetsFeatureVariations[] = {
536 {"", kNTPSnippetsFeatureVariationDefault, 2},
Marc Treib 2016/06/17 13:43:54 The "2"s here are for the number of parameters? Se
jkrcal 2016/06/17 14:13:43 I do not see it either as it is all statically def
Marc Treib 2016/06/17 15:14:50 Well, there's an arraysize() macro (in base/macros
537 {"only personalized", kNTPSnippetsFeatureVariationOnlyPersonal, 2},
538 {"only from most visited sites",
539 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted, 2},
540 {"only personalized from most visited sites",
541 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted, 2},
542 };
543 #endif // defined(OS_ANDROID)
544
545 #if defined(OS_ANDROID)
515 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = { 546 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = {
516 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""}, 547 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""},
517 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY, 548 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY,
518 switches::kForceShowUpdateMenuItemSummary, ""}, 549 switches::kForceShowUpdateMenuItemSummary, ""},
519 {IDS_FLAGS_UPDATE_MENU_ITEM_NEW_FEATURES_SUMMARY, 550 {IDS_FLAGS_UPDATE_MENU_ITEM_NEW_FEATURES_SUMMARY,
520 switches::kForceShowUpdateMenuItemNewFeaturesSummary, ""}, 551 switches::kForceShowUpdateMenuItemNewFeaturesSummary, ""},
521 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY, 552 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY,
522 switches::kForceShowUpdateMenuItemCustomSummary, "Custom summary"}, 553 switches::kForceShowUpdateMenuItemCustomSummary, "Custom summary"},
523 }; 554 };
524 #endif // defined(OS_ANDROID) 555 #endif // defined(OS_ANDROID)
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 extensions::switches::kDisableTabForDesktopShare)}, 1831 extensions::switches::kDisableTabForDesktopShare)},
1801 {"disable-desktop-capture-picker-old-ui", 1832 {"disable-desktop-capture-picker-old-ui",
1802 IDS_FLAG_DISABLE_DESKTOP_CAPTURE_PICKER_OLD_UI, 1833 IDS_FLAG_DISABLE_DESKTOP_CAPTURE_PICKER_OLD_UI,
1803 IDS_FLAG_DISABLE_DESKTOP_CAPTURE_PICKER_OLD_UI_DESCRIPTION, kOsAll, 1834 IDS_FLAG_DISABLE_DESKTOP_CAPTURE_PICKER_OLD_UI_DESCRIPTION, kOsAll,
1804 SINGLE_VALUE_TYPE( 1835 SINGLE_VALUE_TYPE(
1805 extensions::switches::kDisableDesktopCapturePickerOldUI)}, 1836 extensions::switches::kDisableDesktopCapturePickerOldUI)},
1806 #endif 1837 #endif
1807 #if defined(OS_ANDROID) 1838 #if defined(OS_ANDROID)
1808 {"enable-ntp-snippets", IDS_FLAGS_ENABLE_NTP_SNIPPETS_NAME, 1839 {"enable-ntp-snippets", IDS_FLAGS_ENABLE_NTP_SNIPPETS_NAME,
1809 IDS_FLAGS_ENABLE_NTP_SNIPPETS_DESCRIPTION, kOsAndroid, 1840 IDS_FLAGS_ENABLE_NTP_SNIPPETS_DESCRIPTION, kOsAndroid,
1810 FEATURE_VALUE_TYPE(chrome::android::kNTPSnippetsFeature)}, 1841 FEATURE_WITH_VARIATIONS_VALUE_TYPE(chrome::android::kNTPSnippetsFeature,
1842 kNTPSnippetsFeatureVariations,
1843 ntp_snippets::kStudyName)},
1811 #endif // defined(OS_ANDROID) 1844 #endif // defined(OS_ANDROID)
1812 #if defined(ENABLE_WEBRTC) && BUILDFLAG(RTC_USE_H264) 1845 #if defined(ENABLE_WEBRTC) && BUILDFLAG(RTC_USE_H264)
1813 {"enable-webrtc-h264-with-openh264-ffmpeg", 1846 {"enable-webrtc-h264-with-openh264-ffmpeg",
1814 IDS_FLAGS_WEBRTC_H264_WITH_OPENH264_FFMPEG_NAME, 1847 IDS_FLAGS_WEBRTC_H264_WITH_OPENH264_FFMPEG_NAME,
1815 IDS_FLAGS_WEBRTC_H264_WITH_OPENH264_FFMPEG_DESCRIPTION, kOsDesktop, 1848 IDS_FLAGS_WEBRTC_H264_WITH_OPENH264_FFMPEG_DESCRIPTION, kOsDesktop,
1816 FEATURE_VALUE_TYPE(content::kWebRtcH264WithOpenH264FFmpeg)}, 1849 FEATURE_VALUE_TYPE(content::kWebRtcH264WithOpenH264FFmpeg)},
1817 #endif // defined(ENABLE_WEBRTC) && BUILDFLAG(RTC_USE_H264) 1850 #endif // defined(ENABLE_WEBRTC) && BUILDFLAG(RTC_USE_H264)
1818 #if defined(OS_ANDROID) 1851 #if defined(OS_ANDROID)
1819 {"ime-thread", IDS_FLAGS_IME_THREAD_NAME, IDS_FLAGS_IME_THREAD_DESCRIPTION, 1852 {"ime-thread", IDS_FLAGS_IME_THREAD_NAME, IDS_FLAGS_IME_THREAD_DESCRIPTION,
1820 kOsAndroid, FEATURE_VALUE_TYPE(features::kImeThread)}, 1853 kOsAndroid, FEATURE_VALUE_TYPE(features::kImeThread)},
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 #endif 1909 #endif
1877 #if defined(OS_ANDROID) 1910 #if defined(OS_ANDROID)
1878 {"media-style-notification", IDS_FLAGS_MEDIA_STYLE_NOTIFICATION_NAME, 1911 {"media-style-notification", IDS_FLAGS_MEDIA_STYLE_NOTIFICATION_NAME,
1879 IDS_FLAGS_MEDIA_STYLE_NOTIFICATION_DESCRIPTION, kOsAndroid, 1912 IDS_FLAGS_MEDIA_STYLE_NOTIFICATION_DESCRIPTION, kOsAndroid,
1880 FEATURE_VALUE_TYPE(chrome::android::kMediaStyleNotification)}, 1913 FEATURE_VALUE_TYPE(chrome::android::kMediaStyleNotification)},
1881 {"important-sites-in-cbd", IDS_FLAGS_IMPORTANT_SITES_IN_CBD_NAME, 1914 {"important-sites-in-cbd", IDS_FLAGS_IMPORTANT_SITES_IN_CBD_NAME,
1882 IDS_FLAGS_IMPORTANT_SITES_IN_CBD_DESCRIPTION, kOsAndroid, 1915 IDS_FLAGS_IMPORTANT_SITES_IN_CBD_DESCRIPTION, kOsAndroid,
1883 FEATURE_VALUE_TYPE(chrome::android::kImportantSitesInCBD)}, 1916 FEATURE_VALUE_TYPE(chrome::android::kImportantSitesInCBD)},
1884 {"enable-autoplay-muted-videos", 1917 {"enable-autoplay-muted-videos",
1885 IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_NAME, 1918 IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_NAME,
1886 IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_DESCRIPTION, 1919 IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_DESCRIPTION, kOsAndroid,
1887 kOsAndroid,
1888 SINGLE_VALUE_TYPE(switches::kEnableAutoplayMutedVideos)}, 1920 SINGLE_VALUE_TYPE(switches::kEnableAutoplayMutedVideos)},
1889 #endif 1921 #endif
1890 {"enable-pointer-events", // FLAGS:RECORD_UMA 1922 {"enable-pointer-events", // FLAGS:RECORD_UMA
1891 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_NAME, 1923 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_NAME,
1892 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_DESCRIPTION, kOsAll, 1924 IDS_FLAGS_EXPERIMENTAL_POINTER_EVENT_DESCRIPTION, kOsAll,
1893 FEATURE_VALUE_TYPE(features::kPointerEvents)}, 1925 FEATURE_VALUE_TYPE(features::kPointerEvents)},
1894 {"passive-listener-default", // FLAGS:RECORD_UMA 1926 {"passive-listener-default", // FLAGS:RECORD_UMA
1895 IDS_FLAGS_PASSIVE_EVENT_LISTENER_DEFAULT_NAME, 1927 IDS_FLAGS_PASSIVE_EVENT_LISTENER_DEFAULT_NAME,
1896 IDS_FLAGS_PASSIVE_EVENT_LISTENER_DEFAULT_DESCRIPTION, kOsAll, 1928 IDS_FLAGS_PASSIVE_EVENT_LISTENER_DEFAULT_DESCRIPTION, kOsAll,
1897 MULTI_VALUE_TYPE(kPassiveListenersChoices)}, 1929 MULTI_VALUE_TYPE(kPassiveListenersChoices)},
1898 {"enable-loading-ipc-optimization-for-small-resources", 1930 {"enable-loading-ipc-optimization-for-small-resources",
1899 IDS_FLAGS_OPTIMIZE_LOADING_IPC_FOR_SMALL_RESOURCES_NAME, 1931 IDS_FLAGS_OPTIMIZE_LOADING_IPC_FOR_SMALL_RESOURCES_NAME,
1900 IDS_FLAGS_OPTIMIZE_LOADING_IPC_FOR_SMALL_RESOURCES_DESCRIPTION, kOsAll, 1932 IDS_FLAGS_OPTIMIZE_LOADING_IPC_FOR_SMALL_RESOURCES_DESCRIPTION, kOsAll,
1901 FEATURE_VALUE_TYPE(features::kOptimizeLoadingIPCForSmallResources)}, 1933 FEATURE_VALUE_TYPE(features::kOptimizeLoadingIPCForSmallResources)},
1902 {"enable-font-cache-scaling", IDS_FLAGS_FONT_CACHE_SCALING_NAME, 1934 {"enable-font-cache-scaling", IDS_FLAGS_FONT_CACHE_SCALING_NAME,
1903 IDS_FLAGS_FONT_CACHE_SCALING_DESCRIPTION, kOsAll, 1935 IDS_FLAGS_FONT_CACHE_SCALING_DESCRIPTION, kOsAll,
1904 FEATURE_VALUE_TYPE(features::kFontCacheScaling)}, 1936 FEATURE_VALUE_TYPE(features::kFontCacheScaling)},
1905 #if defined(OS_ANDROID) 1937 #if defined(OS_ANDROID)
1906 {"enable-vr-shell", 1938 {"enable-vr-shell", IDS_FLAGS_ENABLE_VR_SHELL_NAME,
1907 IDS_FLAGS_ENABLE_VR_SHELL_NAME,
1908 IDS_FLAGS_ENABLE_VR_SHELL_DESCRIPTION, kOsAndroid, 1939 IDS_FLAGS_ENABLE_VR_SHELL_DESCRIPTION, kOsAndroid,
1909 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableVrShell, 1940 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableVrShell,
1910 switches::kDisableVrShell)}, 1941 switches::kDisableVrShell)},
1911 #endif 1942 #endif
1912 1943
1913 {"enable-weak-memorycache", 1944 {"enable-weak-memorycache", IDS_FLAGS_ENABLE_WEAK_MEMORYCACHE_NAME,
1914 IDS_FLAGS_ENABLE_WEAK_MEMORYCACHE_NAME,
1915 IDS_FLAGS_ENABLE_WEAK_MEMORYCACHE_DESCRIPTION, kOsAll, 1945 IDS_FLAGS_ENABLE_WEAK_MEMORYCACHE_DESCRIPTION, kOsAll,
1916 FEATURE_VALUE_TYPE(features::kWeakMemoryCache)}, 1946 FEATURE_VALUE_TYPE(features::kWeakMemoryCache)},
1917 // NOTE: Adding new command-line switches requires adding corresponding 1947 // NOTE: Adding new command-line switches requires adding corresponding
1918 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 1948 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
1919 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 1949 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
1920 }; 1950 };
1921 1951
1922 class FlagsStateSingleton { 1952 class FlagsStateSingleton {
1923 public: 1953 public:
1924 FlagsStateSingleton() 1954 FlagsStateSingleton()
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2142 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2113 2143
2114 const FeatureEntry* GetFeatureEntries(size_t* count) { 2144 const FeatureEntry* GetFeatureEntries(size_t* count) {
2115 *count = arraysize(kFeatureEntries); 2145 *count = arraysize(kFeatureEntries);
2116 return kFeatureEntries; 2146 return kFeatureEntries;
2117 } 2147 }
2118 2148
2119 } // namespace testing 2149 } // namespace testing
2120 2150
2121 } // namespace about_flags 2151 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698