| OLD | NEW |
| 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 "content/browser/android/content_startup_flags.h" | 5 #include "content/browser/android/content_startup_flags.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
| 12 #include "cc/base/switches.h" | 12 #include "cc/base/switches.h" |
| 13 #include "content/public/browser/android/compositor.h" | 13 #include "content/public/browser/android/compositor.h" |
| 14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "gpu/command_buffer/service/gpu_switches.h" | 15 #include "gpu/command_buffer/service/gpu_switches.h" |
| 16 #include "ui/base/ui_base_switches.h" | 16 #include "ui/base/ui_base_switches.h" |
| 17 #include "ui/native_theme/native_theme_switches.h" | |
| 18 | 17 |
| 19 namespace content { | 18 namespace content { |
| 20 | 19 |
| 21 void SetContentCommandLineFlags(bool single_process, | 20 void SetContentCommandLineFlags(bool single_process, |
| 22 const std::string& plugin_descriptor) { | 21 const std::string& plugin_descriptor) { |
| 23 // May be called multiple times, to cover all possible program entry points. | 22 // May be called multiple times, to cover all possible program entry points. |
| 24 static bool already_initialized = false; | 23 static bool already_initialized = false; |
| 25 if (already_initialized) | 24 if (already_initialized) |
| 26 return; | 25 return; |
| 27 already_initialized = true; | 26 already_initialized = true; |
| 28 | 27 |
| 29 base::CommandLine* parsed_command_line = | 28 base::CommandLine* parsed_command_line = |
| 30 base::CommandLine::ForCurrentProcess(); | 29 base::CommandLine::ForCurrentProcess(); |
| 31 | 30 |
| 32 if (single_process) { | 31 if (single_process) { |
| 33 // Need to ensure the command line flag is consistent as a lot of chrome | 32 // Need to ensure the command line flag is consistent as a lot of chrome |
| 34 // internal code checks this directly, but it wouldn't normally get set when | 33 // internal code checks this directly, but it wouldn't normally get set when |
| 35 // we are implementing an embedded WebView. | 34 // we are implementing an embedded WebView. |
| 36 parsed_command_line->AppendSwitch(switches::kSingleProcess); | 35 parsed_command_line->AppendSwitch(switches::kSingleProcess); |
| 37 } | 36 } |
| 38 | 37 |
| 39 parsed_command_line->AppendSwitch(switches::kEnablePinch); | 38 parsed_command_line->AppendSwitch(switches::kEnablePinch); |
| 40 parsed_command_line->AppendSwitch(switches::kEnableViewport); | 39 parsed_command_line->AppendSwitch(switches::kEnableViewport); |
| 41 parsed_command_line->AppendSwitch(switches::kEnableOverlayScrollbar); | |
| 42 parsed_command_line->AppendSwitch(switches::kValidateInputEventStream); | 40 parsed_command_line->AppendSwitch(switches::kValidateInputEventStream); |
| 43 | 41 |
| 44 if (base::android::BuildInfo::GetInstance()->sdk_int() >= | 42 if (base::android::BuildInfo::GetInstance()->sdk_int() >= |
| 45 base::android::SDK_VERSION_MARSHMALLOW) { | 43 base::android::SDK_VERSION_MARSHMALLOW) { |
| 46 parsed_command_line->AppendSwitch(switches::kEnableLongpressDragSelection); | 44 parsed_command_line->AppendSwitch(switches::kEnableLongpressDragSelection); |
| 47 parsed_command_line->AppendSwitchASCII( | 45 parsed_command_line->AppendSwitchASCII( |
| 48 switches::kTouchTextSelectionStrategy, "direction"); | 46 switches::kTouchTextSelectionStrategy, "direction"); |
| 49 } | 47 } |
| 50 | 48 |
| 51 // There is no software fallback on Android, so don't limit GPU crashes. | 49 // There is no software fallback on Android, so don't limit GPU crashes. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 73 } | 71 } |
| 74 | 72 |
| 75 // Disable profiler timing by default. | 73 // Disable profiler timing by default. |
| 76 if (!parsed_command_line->HasSwitch(switches::kProfilerTiming)) { | 74 if (!parsed_command_line->HasSwitch(switches::kProfilerTiming)) { |
| 77 parsed_command_line->AppendSwitchASCII( | 75 parsed_command_line->AppendSwitchASCII( |
| 78 switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); | 76 switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); |
| 79 } | 77 } |
| 80 } | 78 } |
| 81 | 79 |
| 82 } // namespace content | 80 } // namespace content |
| OLD | NEW |