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

Unified Diff: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java

Issue 227653006: ContentView->ContentViewCore in Shell/ShellManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
index e8a7bfd07f0ef35a437a11b10416c4bfdb25ac27..0683ebecf928a05c62c030c35eb41a6c1447b612 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
@@ -19,6 +19,7 @@ import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.content.browser.BrowserStartupController;
import org.chromium.content.browser.ContentView;
+import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.DeviceUtils;
import org.chromium.content.common.ContentSwitches;
import org.chromium.content_shell.Shell;
@@ -125,9 +126,9 @@ public class ContentShellActivity extends Activity {
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
- Shell activeShell = getActiveShell();
- if (activeShell != null) {
- outState.putString(ACTIVE_SHELL_URL_KEY, activeShell.getContentView().getUrl());
+ ContentViewCore contentViewCore = getActiveContentViewCore();
+ if (contentViewCore != null) {
+ outState.putString(ACTIVE_SHELL_URL_KEY, contentViewCore.getUrl());
}
mWindowAndroid.saveInstanceState(outState);
@@ -144,9 +145,9 @@ public class ContentShellActivity extends Activity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
- ContentView contentView = getActiveContentView();
- if (contentView != null && contentView.canGoBack()) {
- contentView.goBack();
+ ContentViewCore contentViewCore = getActiveContentViewCore();
+ if (contentViewCore != null && contentViewCore.canGoBack()) {
+ contentViewCore.goBack();
return true;
}
}
@@ -175,16 +176,16 @@ public class ContentShellActivity extends Activity {
protected void onStop() {
super.onStop();
- ContentView view = getActiveContentView();
- if (view != null) view.onHide();
+ ContentViewCore contentViewCore = getActiveContentViewCore();
+ if (contentViewCore != null) contentViewCore.onHide();
}
@Override
protected void onStart() {
super.onStart();
- ContentView view = getActiveContentView();
- if (view != null) view.onShow();
+ ContentViewCore contentViewCore = getActiveContentViewCore();
+ if (contentViewCore != null) contentViewCore.onShow();
}
@Override
@@ -224,4 +225,13 @@ public class ContentShellActivity extends Activity {
Shell shell = getActiveShell();
return shell != null ? shell.getContentView() : null;
}
+
+ /**
+ * @return The {@link ContentViewCore} owned by the currently visible {@link Shell} or null if
+ * one is not showing.
+ */
+ public ContentViewCore getActiveContentViewCore() {
+ Shell shell = getActiveShell();
+ return shell != null ? shell.getContentViewCore() : null;
+ }
}
« no previous file with comments | « content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698