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

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

Issue 2805683003: Allow for pausing background tabs on desktop via about:flags. (Closed)
Patch Set: Fix android build Created 3 years, 8 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 | chrome/browser/flag_descriptions.h » ('j') | 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 18 matching lines...) Expand all
29 #include "chrome/browser/flag_descriptions.h" 29 #include "chrome/browser/flag_descriptions.h"
30 #include "chrome/browser/ntp_snippets/ntp_snippets_features.h" 30 #include "chrome/browser/ntp_snippets/ntp_snippets_features.h"
31 #include "chrome/browser/page_load_metrics/experiments/delay_navigation_throttle .h" 31 #include "chrome/browser/page_load_metrics/experiments/delay_navigation_throttle .h"
32 #include "chrome/browser/predictors/resource_prefetch_common.h" 32 #include "chrome/browser/predictors/resource_prefetch_common.h"
33 #include "chrome/browser/prerender/prerender_field_trial.h" 33 #include "chrome/browser/prerender/prerender_field_trial.h"
34 #include "chrome/common/channel_info.h" 34 #include "chrome/common/channel_info.h"
35 #include "chrome/common/chrome_content_client.h" 35 #include "chrome/common/chrome_content_client.h"
36 #include "chrome/common/chrome_features.h" 36 #include "chrome/common/chrome_features.h"
37 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/features.h" 38 #include "chrome/common/features.h"
39 #include "chrome/common/pause_tabs_field_trial.h"
39 #include "chrome/grit/chromium_strings.h" 40 #include "chrome/grit/chromium_strings.h"
40 #include "components/autofill/core/browser/autofill_experiments.h" 41 #include "components/autofill/core/browser/autofill_experiments.h"
41 #include "components/autofill/core/common/autofill_switches.h" 42 #include "components/autofill/core/common/autofill_switches.h"
42 #include "components/browser_sync/browser_sync_switches.h" 43 #include "components/browser_sync/browser_sync_switches.h"
43 #include "components/cloud_devices/common/cloud_devices_switches.h" 44 #include "components/cloud_devices/common/cloud_devices_switches.h"
44 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_featu res.h" 45 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_featu res.h"
45 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" 46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h"
46 #include "components/dom_distiller/core/dom_distiller_switches.h" 47 #include "components/dom_distiller/core/dom_distiller_switches.h"
47 #include "components/error_page/common/error_page_switches.h" 48 #include "components/error_page/common/error_page_switches.h"
48 #include "components/flags_ui/feature_entry.h" 49 #include "components/flags_ui/feature_entry.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 const FeatureEntry::FeatureParam kSpeculativeResourcePrefetchingLearning[] = { 708 const FeatureEntry::FeatureParam kSpeculativeResourcePrefetchingLearning[] = {
708 {predictors::kModeParamName, predictors::kLearningMode}}; 709 {predictors::kModeParamName, predictors::kLearningMode}};
709 710
710 const FeatureEntry::FeatureVariation 711 const FeatureEntry::FeatureVariation
711 kSpeculativeResourcePrefetchingFeatureVariations[] = { 712 kSpeculativeResourcePrefetchingFeatureVariations[] = {
712 {"Prefetching", kSpeculativeResourcePrefetchingPrefetching, 713 {"Prefetching", kSpeculativeResourcePrefetchingPrefetching,
713 arraysize(kSpeculativeResourcePrefetchingPrefetching), nullptr}, 714 arraysize(kSpeculativeResourcePrefetchingPrefetching), nullptr},
714 {"Learning", kSpeculativeResourcePrefetchingLearning, 715 {"Learning", kSpeculativeResourcePrefetchingLearning,
715 arraysize(kSpeculativeResourcePrefetchingLearning), nullptr}}; 716 arraysize(kSpeculativeResourcePrefetchingLearning), nullptr}};
716 717
718 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) || \
719 defined(OS_WIN)
720 const FeatureEntry::FeatureParam kPauseBackgroundTabsMinimalEngagment[] = {
721 {pausetabs::kFeatureName, pausetabs::kModeParamMinimal}};
722
723 const FeatureEntry::FeatureParam kPauseBackgroundTabsLowEngagment[] = {
724 {pausetabs::kFeatureName, pausetabs::kModeParamLow}};
725
726 const FeatureEntry::FeatureParam kPauseBackgroundTabsMediumEngagment[] = {
727 {pausetabs::kFeatureName, pausetabs::kModeParamMedium}};
728
729 const FeatureEntry::FeatureParam kPauseBackgroundTabsHighEngagment[] = {
730 {pausetabs::kFeatureName, pausetabs::kModeParamHigh}};
731
732 const FeatureEntry::FeatureParam kPauseBackgroundTabsMaxEngagment[] = {
733 {pausetabs::kFeatureName, pausetabs::kModeParamMax}};
734
735 const FeatureEntry::FeatureVariation kPauseBackgroundTabsVariations[] = {
736 {"minimal engagement", kPauseBackgroundTabsMinimalEngagment,
737 arraysize(kPauseBackgroundTabsMinimalEngagment), nullptr},
738 {"low engagement", kPauseBackgroundTabsLowEngagment,
739 arraysize(kPauseBackgroundTabsLowEngagment), nullptr},
740 {"medium engagement", kPauseBackgroundTabsMediumEngagment,
741 arraysize(kPauseBackgroundTabsMediumEngagment), nullptr},
742 {"high engagement", kPauseBackgroundTabsHighEngagment,
743 arraysize(kPauseBackgroundTabsHighEngagment), nullptr},
744 {"max engagement", kPauseBackgroundTabsMaxEngagment,
745 arraysize(kPauseBackgroundTabsMaxEngagment), nullptr}};
746 #endif
747
717 #if defined(OS_ANDROID) 748 #if defined(OS_ANDROID)
718 const FeatureEntry::FeatureParam 749 const FeatureEntry::FeatureParam
719 kAutofillCreditCardPopupLayoutFeatureVariationIconAtStart[] = { 750 kAutofillCreditCardPopupLayoutFeatureVariationIconAtStart[] = {
720 {"is_credit_card_icon_at_start", "true"}}; 751 {"is_credit_card_icon_at_start", "true"}};
721 752
722 const FeatureEntry::FeatureParam 753 const FeatureEntry::FeatureParam
723 kAutofillCreditCardPopupLayoutFeatureVariationDropdownItemHeight[] = { 754 kAutofillCreditCardPopupLayoutFeatureVariationDropdownItemHeight[] = {
724 {"dropdown_item_height", "56"}}; 755 {"dropdown_item_height", "56"}};
725 756
726 const FeatureEntry::FeatureParam 757 const FeatureEntry::FeatureParam
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
2597 kDelayNavigationFeatureVariations, 2628 kDelayNavigationFeatureVariations,
2598 "DelayNavigation")}, 2629 "DelayNavigation")},
2599 2630
2600 #if defined(OS_ANDROID) 2631 #if defined(OS_ANDROID)
2601 {"enable-custom-context-menu", 2632 {"enable-custom-context-menu",
2602 flag_descriptions::kEnableCustomContextMenuName, 2633 flag_descriptions::kEnableCustomContextMenuName,
2603 flag_descriptions::kEnableCustomContextMenuDescription, kOsAndroid, 2634 flag_descriptions::kEnableCustomContextMenuDescription, kOsAndroid,
2604 FEATURE_VALUE_TYPE(chrome::android::kCustomContextMenu)}, 2635 FEATURE_VALUE_TYPE(chrome::android::kCustomContextMenu)},
2605 #endif // OS_ANDROID 2636 #endif // OS_ANDROID
2606 2637
2638 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) || \
2639 defined(OS_WIN)
2640 {pausetabs::kFeatureName, flag_descriptions::kPauseBackgroundTabsName,
2641 flag_descriptions::kPauseBackgroundTabsDescription, kOsDesktop,
2642 FEATURE_WITH_PARAMS_VALUE_TYPE(pausetabs::kFeature,
2643 kPauseBackgroundTabsVariations,
2644 "PauseBackgroundTabs")},
2645 #endif
2646
2607 #if defined(USE_ASH) 2647 #if defined(USE_ASH)
2608 {"ash-enable-smooth-screen-rotation", 2648 {"ash-enable-smooth-screen-rotation",
2609 flag_descriptions::kAshEnableSmoothScreenRotationName, 2649 flag_descriptions::kAshEnableSmoothScreenRotationName,
2610 flag_descriptions::kAshEnableSmoothScreenRotationDescription, kOsCrOS, 2650 flag_descriptions::kAshEnableSmoothScreenRotationDescription, kOsCrOS,
2611 SINGLE_VALUE_TYPE(ash::switches::kAshEnableSmoothScreenRotation)}, 2651 SINGLE_VALUE_TYPE(ash::switches::kAshEnableSmoothScreenRotation)},
2612 #endif // defined(USE_ASH) 2652 #endif // defined(USE_ASH)
2613 2653
2614 #if defined(OS_CHROMEOS) 2654 #if defined(OS_CHROMEOS)
2615 {"enable-zip-archiver-on-file-manager", 2655 {"enable-zip-archiver-on-file-manager",
2616 flag_descriptions::kEnableZipArchiverOnFileManagerName, 2656 flag_descriptions::kEnableZipArchiverOnFileManagerName,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2873 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2834 2874
2835 const FeatureEntry* GetFeatureEntries(size_t* count) { 2875 const FeatureEntry* GetFeatureEntries(size_t* count) {
2836 *count = arraysize(kFeatureEntries); 2876 *count = arraysize(kFeatureEntries);
2837 return kFeatureEntries; 2877 return kFeatureEntries;
2838 } 2878 }
2839 2879
2840 } // namespace testing 2880 } // namespace testing
2841 2881
2842 } // namespace about_flags 2882 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/flag_descriptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698