OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 package org.chromium.content.common; | 5 package org.chromium.content.common; |
6 | 6 |
7 /** | 7 /** |
8 * Contains all of the command line switches that are specific to the content/ | 8 * Contains all of the command line switches that are specific to the content/ |
9 * portion of Chromium on Android. | 9 * portion of Chromium on Android. |
10 */ | 10 */ |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Native switch kUtilityProcess | 81 // Native switch kUtilityProcess |
82 public static final String SWITCH_UTILITY_PROCESS = "utility"; | 82 public static final String SWITCH_UTILITY_PROCESS = "utility"; |
83 | 83 |
84 // Native switch kGPUProcess | 84 // Native switch kGPUProcess |
85 public static final String SWITCH_GPU_PROCESS = "gpu-process"; | 85 public static final String SWITCH_GPU_PROCESS = "gpu-process"; |
86 | 86 |
87 // Native switch kDownloadProcess | 87 // Native switch kDownloadProcess |
88 public static final String SWITCH_DOWNLOAD_PROCESS = "download"; | 88 public static final String SWITCH_DOWNLOAD_PROCESS = "download"; |
89 | 89 |
| 90 // Native switches to enable / disable IME's own thread instead of using mai
n UI thread. |
| 91 public static final String ENABLE_IME_THREAD = "enable-ime-thread"; |
| 92 public static final String DISABLE_IME_THREAD = "disable-ime-thread"; |
| 93 |
90 // Prevent instantiation. | 94 // Prevent instantiation. |
91 private ContentSwitches() {} | 95 private ContentSwitches() {} |
92 | 96 |
93 public static String getSwitchValue(final String[] commandLine, String switc
hKey) { | 97 public static String getSwitchValue(final String[] commandLine, String switc
hKey) { |
94 if (commandLine == null || switchKey == null) { | 98 if (commandLine == null || switchKey == null) { |
95 return null; | 99 return null; |
96 } | 100 } |
97 // This format should be matched with the one defined in command_line.h. | 101 // This format should be matched with the one defined in command_line.h. |
98 final String switchKeyPrefix = "--" + switchKey + "="; | 102 final String switchKeyPrefix = "--" + switchKey + "="; |
99 for (String command : commandLine) { | 103 for (String command : commandLine) { |
100 if (command != null && command.startsWith(switchKeyPrefix)) { | 104 if (command != null && command.startsWith(switchKeyPrefix)) { |
101 return command.substring(switchKeyPrefix.length()); | 105 return command.substring(switchKeyPrefix.length()); |
102 } | 106 } |
103 } | 107 } |
104 return null; | 108 return null; |
105 } | 109 } |
106 } | 110 } |
OLD | NEW |