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

Side by Side Diff: content/common/content_switches_internal.cc

Issue 2445453002: Add a base::Feature to change progress bar completion policy. (Closed)
Patch Set: Created 4 years, 1 month 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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "content/common/content_switches_internal.h" 5 #include "content/common/content_switches_internal.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 18 matching lines...) Expand all
29 bool IsUseZoomForDSFEnabledByDefault() { 29 bool IsUseZoomForDSFEnabledByDefault() {
30 #if defined(OS_CHROMEOS) || defined(OS_LINUX) 30 #if defined(OS_CHROMEOS) || defined(OS_LINUX)
31 return true; 31 return true;
32 #elif defined(OS_WIN) 32 #elif defined(OS_WIN)
33 return base::FeatureList::IsEnabled(kUseZoomForDsfEnabledByDefault); 33 return base::FeatureList::IsEnabled(kUseZoomForDsfEnabledByDefault);
34 #else 34 #else
35 return false; 35 return false;
36 #endif 36 #endif
37 } 37 }
38 38
39 #if defined(ANDROID)
40 const base::Feature kProgressBarCompletionResourcesBeforeDOMContentLoaded{
Charlie Reis 2016/10/21 22:07:20 nit: Is there room for a space before the brace, a
Nate Chapin 2016/10/21 22:09:22 Yep, will fix before landing.
41 "progress-bar-completion-resources-before-domContentLoaded",
42 base::FEATURE_DISABLED_BY_DEFAULT};
43 #endif
44
39 } // namespace 45 } // namespace
40 46
41 bool IsPinchToZoomEnabled() { 47 bool IsPinchToZoomEnabled() {
42 const base::CommandLine& command_line = 48 const base::CommandLine& command_line =
43 *base::CommandLine::ForCurrentProcess(); 49 *base::CommandLine::ForCurrentProcess();
44 50
45 // Enable pinch everywhere unless it's been explicitly disabled. 51 // Enable pinch everywhere unless it's been explicitly disabled.
46 return !command_line.HasSwitch(switches::kDisablePinch); 52 return !command_line.HasSwitch(switches::kDisablePinch);
47 } 53 }
48 54
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 if (progress_bar_completion == "loadEvent") 105 if (progress_bar_completion == "loadEvent")
100 return ProgressBarCompletion::LOAD_EVENT; 106 return ProgressBarCompletion::LOAD_EVENT;
101 if (progress_bar_completion == "resourcesBeforeDOMContentLoaded") 107 if (progress_bar_completion == "resourcesBeforeDOMContentLoaded")
102 return ProgressBarCompletion::RESOURCES_BEFORE_DCL; 108 return ProgressBarCompletion::RESOURCES_BEFORE_DCL;
103 if (progress_bar_completion == "domContentLoaded") 109 if (progress_bar_completion == "domContentLoaded")
104 return ProgressBarCompletion::DOM_CONTENT_LOADED; 110 return ProgressBarCompletion::DOM_CONTENT_LOADED;
105 if (progress_bar_completion == 111 if (progress_bar_completion ==
106 "resourcesBeforeDOMContentLoadedAndSameOriginIframes") { 112 "resourcesBeforeDOMContentLoadedAndSameOriginIframes") {
107 return ProgressBarCompletion::RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES; 113 return ProgressBarCompletion::RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES;
108 } 114 }
115 // The command line, which is set by the user, takes priority. Otherwise,
116 // fall back to the feature flag.
117 if (base::FeatureList::IsEnabled(
118 kProgressBarCompletionResourcesBeforeDOMContentLoaded)) {
119 return ProgressBarCompletion::RESOURCES_BEFORE_DCL;
120 }
109 #endif 121 #endif
110 return ProgressBarCompletion::LOAD_EVENT; 122 return ProgressBarCompletion::LOAD_EVENT;
111 } 123 }
112 124
113 } // namespace content 125 } // namespace content
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