OLD | NEW |
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 Loading... |
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 { |
| 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 Loading... |
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 |
OLD | NEW |