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