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

Side by Side Diff: chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.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 (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 package org.chromium.chrome.testshell; 5 package org.chromium.chrome.testshell;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.os.Bundle; 9 import android.os.Bundle;
10 import android.text.TextUtils; 10 import android.text.TextUtils;
11 import android.util.Log; 11 import android.util.Log;
12 import android.view.KeyEvent; 12 import android.view.KeyEvent;
13 import android.view.Menu; 13 import android.view.Menu;
14 import android.view.MenuInflater; 14 import android.view.MenuInflater;
15 import android.view.MenuItem; 15 import android.view.MenuItem;
16 import android.widget.Toast; 16 import android.widget.Toast;
17 17
18 import org.chromium.base.BaseSwitches;
19 import org.chromium.base.CommandLine;
18 import org.chromium.base.MemoryPressureListener; 20 import org.chromium.base.MemoryPressureListener;
19 import org.chromium.chrome.browser.DevToolsServer; 21 import org.chromium.chrome.browser.DevToolsServer;
20 import org.chromium.chrome.testshell.sync.SyncController; 22 import org.chromium.chrome.testshell.sync.SyncController;
21 import org.chromium.content.browser.ActivityContentVideoViewClient; 23 import org.chromium.content.browser.ActivityContentVideoViewClient;
22 import org.chromium.content.browser.BrowserStartupController; 24 import org.chromium.content.browser.BrowserStartupController;
23 import org.chromium.content.browser.ContentVideoViewClient; 25 import org.chromium.content.browser.ContentVideoViewClient;
24 import org.chromium.content.browser.ContentView; 26 import org.chromium.content.browser.ContentView;
25 import org.chromium.content.browser.ContentViewClient; 27 import org.chromium.content.browser.ContentViewClient;
26 import org.chromium.content.browser.DeviceUtils; 28 import org.chromium.content.browser.DeviceUtils;
27 import org.chromium.content.common.CommandLine;
28 import org.chromium.sync.signin.ChromeSigninController; 29 import org.chromium.sync.signin.ChromeSigninController;
29 import org.chromium.ui.base.ActivityWindowAndroid; 30 import org.chromium.ui.base.ActivityWindowAndroid;
30 import org.chromium.ui.base.WindowAndroid; 31 import org.chromium.ui.base.WindowAndroid;
31 32
32 /** 33 /**
33 * The {@link android.app.Activity} component of a basic test shell to test Chro me features. 34 * The {@link android.app.Activity} component of a basic test shell to test Chro me features.
34 */ 35 */
35 public class ChromiumTestShellActivity extends Activity implements MenuHandler { 36 public class ChromiumTestShellActivity extends Activity implements MenuHandler {
36 private static final String TAG = "ChromiumTestShellActivity"; 37 private static final String TAG = "ChromiumTestShellActivity";
37 38
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 menu.setGroupVisible(R.id.MAIN_MENU, true); 219 menu.setGroupVisible(R.id.MAIN_MENU, true);
219 MenuItem signinItem = menu.findItem(R.id.signin); 220 MenuItem signinItem = menu.findItem(R.id.signin);
220 if (ChromeSigninController.get(this).isSignedIn()) 221 if (ChromeSigninController.get(this).isSignedIn())
221 signinItem.setTitle(ChromeSigninController.get(this).getSignedInAcco untName()); 222 signinItem.setTitle(ChromeSigninController.get(this).getSignedInAcco untName());
222 else 223 else
223 signinItem.setTitle(R.string.signin_sign_in); 224 signinItem.setTitle(R.string.signin_sign_in);
224 return true; 225 return true;
225 } 226 }
226 227
227 private void waitForDebuggerIfNeeded() { 228 private void waitForDebuggerIfNeeded() {
228 if (CommandLine.getInstance().hasSwitch(CommandLine.WAIT_FOR_JAVA_DEBUGG ER)) { 229 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG GER)) {
229 Log.e(TAG, "Waiting for Java debugger to connect..."); 230 Log.e(TAG, "Waiting for Java debugger to connect...");
230 android.os.Debug.waitForDebugger(); 231 android.os.Debug.waitForDebugger();
231 Log.e(TAG, "Java debugger connected. Resuming execution."); 232 Log.e(TAG, "Java debugger connected. Resuming execution.");
232 } 233 }
233 } 234 }
234 235
235 private static String getUrlFromIntent(Intent intent) { 236 private static String getUrlFromIntent(Intent intent) {
236 return intent != null ? intent.getDataString() : null; 237 return intent != null ? intent.getDataString() : null;
237 } 238 }
238 } 239 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698