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.content_shell_apk; | 5 package org.chromium.content_shell_apk; |
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.widget.Toast; | 13 import android.widget.Toast; |
14 | 14 |
15 import org.chromium.base.BaseSwitches; | 15 import org.chromium.base.BaseSwitches; |
16 import org.chromium.base.CommandLine; | 16 import org.chromium.base.CommandLine; |
17 import org.chromium.base.MemoryPressureListener; | 17 import org.chromium.base.MemoryPressureListener; |
18 import org.chromium.base.library_loader.LibraryLoader; | 18 import org.chromium.base.library_loader.LibraryLoader; |
19 import org.chromium.base.library_loader.ProcessInitException; | 19 import org.chromium.base.library_loader.ProcessInitException; |
20 import org.chromium.content.app.ContentApplication; | 20 import org.chromium.content.app.ContentApplication; |
21 import org.chromium.content.browser.BrowserStartupController; | 21 import org.chromium.content.browser.BrowserStartupController; |
22 import org.chromium.content.browser.ContentViewCore; | 22 import org.chromium.content.browser.ContentViewCore; |
23 import org.chromium.content.browser.DeviceUtils; | 23 import org.chromium.content.browser.DeviceUtils; |
24 import org.chromium.content.common.ContentSwitches; | 24 import org.chromium.content.common.ContentSwitches; |
| 25 import org.chromium.content_public.browser.WebContents; |
25 import org.chromium.content_shell.Shell; | 26 import org.chromium.content_shell.Shell; |
26 import org.chromium.content_shell.ShellManager; | 27 import org.chromium.content_shell.ShellManager; |
27 import org.chromium.ui.base.ActivityWindowAndroid; | 28 import org.chromium.ui.base.ActivityWindowAndroid; |
28 import org.chromium.ui.base.WindowAndroid; | 29 import org.chromium.ui.base.WindowAndroid; |
29 | 30 |
30 /** | 31 /** |
31 * Activity for managing the Content Shell. | 32 * Activity for managing the Content Shell. |
32 */ | 33 */ |
33 public class ContentShellActivity extends Activity { | 34 public class ContentShellActivity extends Activity { |
34 | 35 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 218 } |
218 | 219 |
219 /** | 220 /** |
220 * @return The {@link ContentViewCore} owned by the currently visible {@link
Shell} or null if | 221 * @return The {@link ContentViewCore} owned by the currently visible {@link
Shell} or null if |
221 * one is not showing. | 222 * one is not showing. |
222 */ | 223 */ |
223 public ContentViewCore getActiveContentViewCore() { | 224 public ContentViewCore getActiveContentViewCore() { |
224 Shell shell = getActiveShell(); | 225 Shell shell = getActiveShell(); |
225 return shell != null ? shell.getContentViewCore() : null; | 226 return shell != null ? shell.getContentViewCore() : null; |
226 } | 227 } |
| 228 |
| 229 /** |
| 230 * @return The {@link WebContents} owned by the currently visible {@link She
ll} or null if |
| 231 * one is not showing. |
| 232 */ |
| 233 public WebContents getActiveWebContents() { |
| 234 Shell shell = getActiveShell(); |
| 235 return shell != null ? shell.getWebContents() : null; |
| 236 } |
| 237 |
227 } | 238 } |
OLD | NEW |