| 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_linker_test_apk; | 5 package org.chromium.content_linker_test_apk; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.os.Bundle; | 10 import android.os.Bundle; |
| 11 import android.util.Log; | 11 import android.util.Log; |
| 12 import android.view.LayoutInflater; | 12 import android.view.LayoutInflater; |
| 13 import android.view.View; | 13 import android.view.View; |
| 14 | 14 |
| 15 import org.chromium.base.BaseSwitches; |
| 16 import org.chromium.base.CommandLine; |
| 15 import org.chromium.content.app.LibraryLoader; | 17 import org.chromium.content.app.LibraryLoader; |
| 16 import org.chromium.content.app.Linker; | 18 import org.chromium.content.app.Linker; |
| 17 import org.chromium.content.browser.BrowserStartupController; | 19 import org.chromium.content.browser.BrowserStartupController; |
| 18 import org.chromium.content.browser.ContentView; | 20 import org.chromium.content.browser.ContentView; |
| 19 import org.chromium.content.browser.ContentViewClient; | 21 import org.chromium.content.browser.ContentViewClient; |
| 20 import org.chromium.content.common.CommandLine; | |
| 21 import org.chromium.content.common.ProcessInitException; | 22 import org.chromium.content.common.ProcessInitException; |
| 22 import org.chromium.content_shell.Shell; | 23 import org.chromium.content_shell.Shell; |
| 23 import org.chromium.content_shell.ShellManager; | 24 import org.chromium.content_shell.ShellManager; |
| 24 import org.chromium.ui.base.ActivityWindowAndroid; | 25 import org.chromium.ui.base.ActivityWindowAndroid; |
| 25 import org.chromium.ui.base.WindowAndroid; | 26 import org.chromium.ui.base.WindowAndroid; |
| 26 | 27 |
| 27 public class ContentLinkerTestActivity extends Activity { | 28 public class ContentLinkerTestActivity extends Activity { |
| 28 public static final String COMMAND_LINE_FILE = | 29 public static final String COMMAND_LINE_FILE = |
| 29 "/data/local/tmp/content-linker-test-command-line"; | 30 "/data/local/tmp/content-linker-test-command-line"; |
| 30 | 31 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 finish(); | 129 finish(); |
| 129 } | 130 } |
| 130 | 131 |
| 131 @Override | 132 @Override |
| 132 protected void onSaveInstanceState(Bundle outState) { | 133 protected void onSaveInstanceState(Bundle outState) { |
| 133 super.onSaveInstanceState(outState); | 134 super.onSaveInstanceState(outState); |
| 134 mWindowAndroid.saveInstanceState(outState); | 135 mWindowAndroid.saveInstanceState(outState); |
| 135 } | 136 } |
| 136 | 137 |
| 137 private void waitForDebuggerIfNeeded() { | 138 private void waitForDebuggerIfNeeded() { |
| 138 if (CommandLine.getInstance().hasSwitch(CommandLine.WAIT_FOR_JAVA_DEBUGG
ER)) { | 139 if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUG
GER)) { |
| 139 Log.e(TAG, "Waiting for Java debugger to connect..."); | 140 Log.e(TAG, "Waiting for Java debugger to connect..."); |
| 140 android.os.Debug.waitForDebugger(); | 141 android.os.Debug.waitForDebugger(); |
| 141 Log.e(TAG, "Java debugger connected. Resuming execution."); | 142 Log.e(TAG, "Java debugger connected. Resuming execution."); |
| 142 } | 143 } |
| 143 } | 144 } |
| 144 | 145 |
| 145 @Override | 146 @Override |
| 146 protected void onStop() { | 147 protected void onStop() { |
| 147 super.onStop(); | 148 super.onStop(); |
| 148 | 149 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 if (mShellManager == null) | 181 if (mShellManager == null) |
| 181 return null; | 182 return null; |
| 182 | 183 |
| 183 Shell shell = mShellManager.getActiveShell(); | 184 Shell shell = mShellManager.getActiveShell(); |
| 184 if (shell == null) | 185 if (shell == null) |
| 185 return null; | 186 return null; |
| 186 | 187 |
| 187 return shell.getContentView(); | 188 return shell.getContentView(); |
| 188 } | 189 } |
| 189 } | 190 } |
| OLD | NEW |