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/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 74 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
75 bool enabled = | 75 bool enabled = |
76 (command_line->HasSwitch(switches::kEnableUseZoomForDSF) || | 76 (command_line->HasSwitch(switches::kEnableUseZoomForDSF) || |
77 use_zoom_for_dsf_enabled_by_default) && | 77 use_zoom_for_dsf_enabled_by_default) && |
78 command_line->GetSwitchValueASCII( | 78 command_line->GetSwitchValueASCII( |
79 switches::kEnableUseZoomForDSF) != "false"; | 79 switches::kEnableUseZoomForDSF) != "false"; |
80 | 80 |
81 return enabled; | 81 return enabled; |
82 } | 82 } |
83 | 83 |
| 84 ProgressBarCompletion GetProgressBarCompletionPolicy() { |
| 85 #if defined(OS_ANDROID) |
| 86 const base::CommandLine& command_line = |
| 87 *base::CommandLine::ForCurrentProcess(); |
| 88 std::string progress_bar_completion = |
| 89 command_line.GetSwitchValueASCII(switches::kProgressBarCompletion); |
| 90 if (progress_bar_completion == "loadEvent") |
| 91 return ProgressBarCompletion::LOAD_EVENT; |
| 92 if (progress_bar_completion == "resourcesBeforeDOMContentLoaded") |
| 93 return ProgressBarCompletion::RESOURCES_BEFORE_DCL; |
| 94 if (progress_bar_completion == "domContentLoaded") |
| 95 return ProgressBarCompletion::DOM_CONTENT_LOADED; |
| 96 if (progress_bar_completion == |
| 97 "resourcesBeforeDOMContentLoadedAndSameOriginIframes") { |
| 98 return ProgressBarCompletion::RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES; |
| 99 } |
| 100 #endif |
| 101 return ProgressBarCompletion::LOAD_EVENT; |
| 102 } |
| 103 |
84 } // namespace content | 104 } // namespace content |
OLD | NEW |