| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.android_webview.shell; | 5 package org.chromium.android_webview.shell; |
| 6 | 6 |
| 7 import android.os.Debug; | |
| 8 import android.util.Log; | |
| 9 | |
| 10 import org.chromium.android_webview.AwBrowserProcess; | 7 import org.chromium.android_webview.AwBrowserProcess; |
| 11 import org.chromium.android_webview.R; | 8 import org.chromium.android_webview.R; |
| 12 import org.chromium.base.BaseSwitches; | |
| 13 import org.chromium.base.CommandLine; | 9 import org.chromium.base.CommandLine; |
| 14 import org.chromium.base.TraceEvent; | |
| 15 import org.chromium.base.annotations.SuppressFBWarnings; | 10 import org.chromium.base.annotations.SuppressFBWarnings; |
| 16 import org.chromium.content.app.ContentApplication; | 11 import org.chromium.content.app.ContentApplication; |
| 17 import org.chromium.ui.base.ResourceBundle; | 12 import org.chromium.ui.base.ResourceBundle; |
| 18 | 13 |
| 19 /** | 14 /** |
| 20 * The android_webview shell Application subclass. | 15 * The android_webview shell Application subclass. |
| 21 */ | 16 */ |
| 22 public class AwShellApplication extends ContentApplication { | 17 public class AwShellApplication extends ContentApplication { |
| 23 | |
| 24 private static final String TAG = "AwShellApplication"; | |
| 25 | |
| 26 @SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") | |
| 27 @Override | 18 @Override |
| 28 public void onCreate() { | 19 public void onCreate() { |
| 29 super.onCreate(); | 20 super.onCreate(); |
| 30 | |
| 31 AwShellResourceProvider.registerResources(this); | |
| 32 | |
| 33 CommandLine.initFromFile("/data/local/tmp/android-webview-command-line")
; | |
| 34 | |
| 35 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG
GER)) { | |
| 36 Log.e(TAG, "Waiting for Java debugger to connect..."); | |
| 37 Debug.waitForDebugger(); | |
| 38 Log.e(TAG, "Java debugger connected. Resuming execution."); | |
| 39 } | |
| 40 | |
| 41 AwBrowserProcess.loadLibrary(this); | |
| 42 | |
| 43 if (CommandLine.getInstance().hasSwitch(AwShellSwitches.ENABLE_ATRACE))
{ | |
| 44 Log.e(TAG, "Enabling Android trace."); | |
| 45 TraceEvent.setATraceEnabled(true); | |
| 46 } | |
| 47 } | 21 } |
| 48 | 22 |
| 49 @Override | 23 @Override |
| 50 protected void initializeLibraryDependencies() { | 24 protected void initializeLibraryDependencies() { |
| 51 ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); | 25 ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); |
| 52 } | 26 } |
| 53 | 27 |
| 28 @SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") |
| 54 @Override | 29 @Override |
| 55 public void initCommandLine() { | 30 public void initCommandLine() { |
| 56 throw new UnsupportedOperationException(); | 31 if (!CommandLine.isInitialized()) { |
| 32 CommandLine.initFromFile("/data/local/tmp/android-webview-command-li
ne"); |
| 33 } |
| 57 } | 34 } |
| 58 } | 35 } |
| OLD | NEW |