| 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" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
| 16 #include "ui/gfx/win/direct_write.h" | 16 #include "ui/gfx/win/direct_write.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 #if defined(OS_CHROMEOS) |
| 20 #include "base/sys_info.h" |
| 21 #endif |
| 22 |
| 19 namespace content { | 23 namespace content { |
| 20 | 24 |
| 21 namespace { | 25 namespace { |
| 22 | 26 |
| 23 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 24 static bool g_win32k_renderer_lockdown_disabled = false; | 28 static bool g_win32k_renderer_lockdown_disabled = false; |
| 25 #endif | 29 #endif |
| 26 | 30 |
| 31 bool IsUseZoomForDSFEnabledByDefault() { |
| 32 #if defined(OS_CHROMEOS) |
| 33 // TODO(oshima): Device emulation needs to be fixed to pass |
| 34 // all tests on bots. crbug.com/584709. |
| 35 return base::SysInfo::IsRunningOnChromeOS(); |
| 36 #else |
| 37 return false; |
| 38 #endif |
| 39 } |
| 40 |
| 27 } // namespace | 41 } // namespace |
| 28 | 42 |
| 29 bool IsPinchToZoomEnabled() { | 43 bool IsPinchToZoomEnabled() { |
| 30 const base::CommandLine& command_line = | 44 const base::CommandLine& command_line = |
| 31 *base::CommandLine::ForCurrentProcess(); | 45 *base::CommandLine::ForCurrentProcess(); |
| 32 | 46 |
| 33 // --disable-pinch should always disable pinch | 47 // --disable-pinch should always disable pinch |
| 34 if (command_line.HasSwitch(switches::kDisablePinch)) | 48 if (command_line.HasSwitch(switches::kDisablePinch)) |
| 35 return false; | 49 return false; |
| 36 | 50 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } else if (v8_cache_options == "parse") { | 91 } else if (v8_cache_options == "parse") { |
| 78 return V8_CACHE_OPTIONS_PARSE; | 92 return V8_CACHE_OPTIONS_PARSE; |
| 79 } else if (v8_cache_options == "code") { | 93 } else if (v8_cache_options == "code") { |
| 80 return V8_CACHE_OPTIONS_CODE; | 94 return V8_CACHE_OPTIONS_CODE; |
| 81 } else { | 95 } else { |
| 82 return V8_CACHE_OPTIONS_DEFAULT; | 96 return V8_CACHE_OPTIONS_DEFAULT; |
| 83 } | 97 } |
| 84 } | 98 } |
| 85 | 99 |
| 86 bool IsUseZoomForDSFEnabled() { | 100 bool IsUseZoomForDSFEnabled() { |
| 101 static bool use_zoom_for_dsf_enabled_by_default = |
| 102 IsUseZoomForDSFEnabledByDefault(); |
| 87 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 103 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 88 bool enabled = command_line->HasSwitch(switches::kEnableUseZoomForDSF) && | 104 bool enabled = |
| 89 command_line->GetSwitchValueASCII( | 105 (command_line->HasSwitch(switches::kEnableUseZoomForDSF) || |
| 90 switches::kEnableUseZoomForDSF) != "false"; | 106 use_zoom_for_dsf_enabled_by_default) && |
| 107 command_line->GetSwitchValueASCII( |
| 108 switches::kEnableUseZoomForDSF) != "false"; |
| 91 | 109 |
| 92 return enabled; | 110 return enabled; |
| 93 } | 111 } |
| 94 | 112 |
| 95 } // namespace content | 113 } // namespace content |
| OLD | NEW |