Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: base/android/java/src/org/chromium/base/CommandLine.java

Issue 62333025: [Android] Move CommandLine.java to base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 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.base;
6 6
7 import android.text.TextUtils; 7 import android.text.TextUtils;
8 import android.util.Log; 8 import android.util.Log;
9 9
10 import java.io.File; 10 import java.io.File;
11 import java.io.FileInputStream; 11 import java.io.FileInputStream;
12 import java.io.FileNotFoundException; 12 import java.io.FileNotFoundException;
13 import java.io.IOException; 13 import java.io.IOException;
14 import java.io.InputStreamReader; 14 import java.io.InputStreamReader;
15 import java.io.Reader; 15 import java.io.Reader;
16 import java.util.ArrayList; 16 import java.util.ArrayList;
17 import java.util.Arrays; 17 import java.util.Arrays;
18 import java.util.HashMap; 18 import java.util.HashMap;
19 import java.util.concurrent.atomic.AtomicReference; 19 import java.util.concurrent.atomic.AtomicReference;
20 20
21 /** 21 /**
22 * Java mirror of Chrome command-line utilities (e.g. class CommandLine from bas e/command_line.h). 22 * Java mirror of base/command_line.h.
23 * Command line program adb_command_line can be used to set the Chrome command l ine: 23 * Android applications don't have command line arguments. Instead, they're "sim ulated" by reading a
24 * adb shell "echo chrome --my-param > /data/local/chrome-command-line" 24 * file at a specific location early during startup. Applications each define th eir own files, e.g.,
25 */ 25 * ContentShellActivity.COMMAND_LINE_FILE or ChromiumTestShellApplication.COMMAN D_LINE_FILE.
26 **/
26 public abstract class CommandLine { 27 public abstract class CommandLine {
27 // Block onCreate() of Chrome until a Java debugger is attached.
28 public static final String WAIT_FOR_JAVA_DEBUGGER = "wait-for-java-debugger" ;
29
30 // Tell Java to use the official command line, loaded from the
31 // official-command-line.xml files. WARNING this is not done
32 // immediately on startup, so early running Java code will not see
33 // these flags.
34 public static final String ADD_OFFICIAL_COMMAND_LINE = "add-official-command -line";
35
36 // Enables test intent handling.
37 public static final String ENABLE_TEST_INTENTS = "enable-test-intents";
38
39 // Adds additional thread idle time information into the trace event output.
40 public static final String ENABLE_IDLE_TRACING = "enable-idle-tracing";
41
42 // Dump frames-per-second to the log
43 public static final String LOG_FPS = "log-fps";
44
45 // Whether Chromium should use a mobile user agent.
46 public static final String USE_MOBILE_UA = "use-mobile-user-agent";
47
48 // tablet specific UI components.
49 // Native switch - chrome_switches::kTabletUI
50 public static final String TABLET_UI = "tablet-ui";
51
52 // Change the url of the JavaScript that gets injected when accessibility mo de is enabled.
53 public static final String ACCESSIBILITY_JAVASCRIPT_URL = "accessibility-js- url";
54
55 public static final String ACCESSIBILITY_DEBUG_BRAILLE_SERVICE = "debug-brai lle-service";
56
57 // Sets the ISO country code that will be used for phone number detection.
58 public static final String NETWORK_COUNTRY_ISO = "network-country-iso";
59
60 // Whether to enable the auto-hiding top controls.
61 public static final String ENABLE_TOP_CONTROLS_POSITION_CALCULATION
62 = "enable-top-controls-position-calculation";
63
64 // The height of the movable top controls.
65 public static final String TOP_CONTROLS_HEIGHT = "top-controls-height";
66
67 // How much of the top controls need to be shown before they will auto show.
68 public static final String TOP_CONTROLS_SHOW_THRESHOLD = "top-controls-show- threshold";
69
70 // How much of the top controls need to be hidden before they will auto hide .
71 public static final String TOP_CONTROLS_HIDE_THRESHOLD = "top-controls-hide- threshold";
72
73 // Native switch - chrome_switches::kEnableInstantExtendedAPI
74 public static final String ENABLE_INSTANT_EXTENDED_API = "enable-instant-ext ended-api";
75
76 // Native switch - content_switches::kEnableSpeechRecognition
77 public static final String ENABLE_SPEECH_RECOGNITION = "enable-speech-recogn ition";
78
79 // Native switch - shell_switches::kDumpRenderTree
80 public static final String DUMP_RENDER_TREE = "dump-render-tree";
81
82 // Native switch - chrome_switches::kDisablePopupBlocking
83 public static final String DISABLE_POPUP_BLOCKING = "disable-popup-blocking" ;
84
85 // Whether to disable the click delay by sending click events during double tap
86 public static final String DISABLE_CLICK_DELAY = "disable-click-delay";
87
88 // Public abstract interface, implemented in derived classes. 28 // Public abstract interface, implemented in derived classes.
89 // All these methods reflect their native-side counterparts. 29 // All these methods reflect their native-side counterparts.
90 /** 30 /**
91 * Returns true if this command line contains the given switch. 31 * Returns true if this command line contains the given switch.
92 * (Switch names ARE case-sensitive). 32 * (Switch names ARE case-sensitive).
93 */ 33 */
94 public abstract boolean hasSwitch(String switchString); 34 public abstract boolean hasSwitch(String switchString);
95 35
96 /** 36 /**
97 * Return the value associated with the given switch, or null. 37 * Return the value associated with the given switch, or null.
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 369 }
430 } 370 }
431 371
432 private static native void nativeReset(); 372 private static native void nativeReset();
433 private static native boolean nativeHasSwitch(String switchString); 373 private static native boolean nativeHasSwitch(String switchString);
434 private static native String nativeGetSwitchValue(String switchString); 374 private static native String nativeGetSwitchValue(String switchString);
435 private static native void nativeAppendSwitch(String switchString); 375 private static native void nativeAppendSwitch(String switchString);
436 private static native void nativeAppendSwitchWithValue(String switchString, String value); 376 private static native void nativeAppendSwitchWithValue(String switchString, String value);
437 private static native void nativeAppendSwitchesAndArguments(String[] array); 377 private static native void nativeAppendSwitchesAndArguments(String[] array);
438 }; 378 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698