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

Unified Diff: content/shell/android/aura_shell_apk/src/org/chromium/aura_content_shell_apk/ContentShellActivity.java

Issue 1284343005: NOT FOR REVIEW: Aura on Android - content shell compiles Base URL: https://chromium.googlesource.com/chromium/src.git@build_ALL_patch
Patch Set: Created 5 years, 4 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
Index: content/shell/android/aura_shell_apk/src/org/chromium/aura_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/aura_shell_apk/src/org/chromium/aura_content_shell_apk/ContentShellActivity.java
similarity index 63%
copy from content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
copy to content/shell/android/aura_shell_apk/src/org/chromium/aura_content_shell_apk/ContentShellActivity.java
index 95ab6033a6c74bb4eb7c8a86ff6c91b09d28d3c9..37dd3e0d2e31be2185153ae7cbbab10c649215f8 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ b/content/shell/android/aura_shell_apk/src/org/chromium/aura_content_shell_apk/ContentShellActivity.java
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.content_shell_apk;
+package org.chromium.aura_content_shell_apk;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
-import android.view.KeyEvent;
+//import android.view.KeyEvent;
import android.widget.Toast;
import org.chromium.base.BaseSwitches;
@@ -21,13 +21,15 @@ import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.content.app.ContentApplication;
import org.chromium.content.browser.BrowserStartupController;
-import org.chromium.content.browser.ContentViewCore;
+//import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.DeviceUtils;
import org.chromium.content.common.ContentSwitches;
-import org.chromium.content_public.browser.WebContents;
+//import org.chromium.content_public.browser.WebContents;
import org.chromium.content_shell.Shell;
-import org.chromium.content_shell.ShellManager;
-import org.chromium.ui.base.ActivityWindowAndroid;
+//import org.chromium.content_shell.ShellManager;
+//import org.chromium.ui.base.ActivityWindowAndroid;
+
+//import org.chromium.ui.PlatformWindowAndroid;
/**
* Activity for managing the Content Shell.
@@ -39,10 +41,13 @@ public class ContentShellActivity extends Activity {
private static final String ACTIVE_SHELL_URL_KEY = "activeUrl";
public static final String COMMAND_LINE_ARGS_KEY = "commandLineArgs";
- private ShellManager mShellManager;
- private ActivityWindowAndroid mWindowAndroid;
+// private PlatformWindowAndroid mPlatformWindowAndroid;
+// private ShellManager mShellManager;
+// private ActivityWindowAndroid mWindowAndroid;
private Intent mLastSentIntent;
+ private Shell mActiveShell;
+
@Override
@SuppressFBWarnings("DM_EXIT")
protected void onCreate(final Bundle savedInstanceState) {
@@ -70,26 +75,28 @@ public class ContentShellActivity extends Activity {
return;
}
- setContentView(R.layout.content_shell_activity);
- mShellManager = (ShellManager) findViewById(R.id.shell_container);
+ // ContentView will be set by PWA
+ //setContentView(R.layout.content_shell_activity);
+// mShellManager = (ShellManager) findViewById(R.id.shell_container);
final boolean listenToActivityState = true;
- mWindowAndroid = new ActivityWindowAndroid(this, listenToActivityState);
- mWindowAndroid.restoreInstanceState(savedInstanceState);
- mShellManager.setWindow(mWindowAndroid);
+// mWindowAndroid = new ActivityWindowAndroid(this, listenToActivityState);
+// mWindowAndroid.restoreInstanceState(savedInstanceState);
+// mShellManager.setWindow(mWindowAndroid);
// Set up the animation placeholder to be the SurfaceView. This disables the
// SurfaceView's 'hole' clipping during animations that are notified to the window.
- mWindowAndroid.setAnimationPlaceholderView(
- mShellManager.getContentViewRenderView().getSurfaceView());
+// mWindowAndroid.setAnimationPlaceholderView(
+// mShellManager.getContentViewRenderView().getSurfaceView());
- String startupUrl = getUrlFromIntent(getIntent());
- if (!TextUtils.isEmpty(startupUrl)) {
- mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
- }
+// String startupUrl = getUrlFromIntent(getIntent());
+// if (!TextUtils.isEmpty(startupUrl)) {
+// mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
+// }
+ //mActiveShell
if (CommandLine.getInstance().hasSwitch(ContentSwitches.RUN_LAYOUT_TEST)
|| CommandLine.getInstance().hasSwitch(ContentSwitches.DUMP_RENDER_TREE)) {
try {
- BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER)
+ BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER, false)
.startBrowserProcessesSync(false);
} catch (ProcessInitException e) {
Log.e(TAG, "Failed to load native library.", e);
@@ -97,7 +104,7 @@ public class ContentShellActivity extends Activity {
}
} else {
try {
- BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER)
+ BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER, false)
.startBrowserProcessesAsync(
new BrowserStartupController.StartupCallback() {
@Override
@@ -118,31 +125,33 @@ public class ContentShellActivity extends Activity {
}
private void finishInitialization(Bundle savedInstanceState) {
- String shellUrl = ShellManager.DEFAULT_SHELL_URL;
- if (savedInstanceState != null
- && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
- shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
- }
- mShellManager.launchShell(shellUrl);
+// String shellUrl = ShellManager.DEFAULT_SHELL_URL;
+// if (savedInstanceState != null
+// && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
+// shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
+// }
+// mShellManager.launchShell(shellUrl);
mfomitchev 2015/08/12 22:18:46 So.. I was thinking whether we need to Shell::Crea
Yaron 2015/08/13 13:40:07 It could be that we don't need this at all. This c
mfomitchev 2015/08/13 15:33:03 Let me see if I understand this correctly. First
Yaron 2015/08/13 18:54:03 I think so, ya. It looks like BrowserStartupContro
mfomitchev 2015/08/13 21:08:23 At this point I don't even have ContentViewCore..
Yaron 2015/08/14 15:10:24 Ya, you don't have it it. It's created on demand i
}
private void initializationFailed() {
Log.e(TAG, "ContentView initialization failed.");
Toast.makeText(ContentShellActivity.this,
- R.string.browser_process_initialization_failed,
+ //TODO(mfomitchev): string
+ "Initialization failed.",
+ //R.string.browser_process_initialization_failed,
Toast.LENGTH_SHORT).show();
finish();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- ContentViewCore contentViewCore = getActiveContentViewCore();
- if (contentViewCore != null) {
- outState.putString(ACTIVE_SHELL_URL_KEY, contentViewCore.getWebContents().getUrl());
- }
-
- mWindowAndroid.saveInstanceState(outState);
+// super.onSaveInstanceState(outState);
+// ContentViewCore contentViewCore = getActiveContentViewCore();
+// if (contentViewCore != null) {
+// outState.putString(ACTIVE_SHELL_URL_KEY, contentViewCore.getWebContents().getUrl());
+// }
+//
+// mWindowAndroid.saveInstanceState(outState);
}
private void waitForDebuggerIfNeeded() {
@@ -154,20 +163,6 @@ public class ContentShellActivity extends Activity {
}
@Override
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK) {
- ContentViewCore contentViewCore = getActiveContentViewCore();
- if (contentViewCore != null && contentViewCore.getWebContents()
- .getNavigationController().canGoBack()) {
- contentViewCore.getWebContents().getNavigationController().goBack();
- return true;
- }
- }
-
- return super.onKeyUp(keyCode, event);
- }
-
- @Override
protected void onNewIntent(Intent intent) {
if (getCommandLineParamsFromIntent(intent) != null) {
Log.i(TAG, "Ignoring command line params: can only be set when creating the activity.");
@@ -177,10 +172,10 @@ public class ContentShellActivity extends Activity {
String url = getUrlFromIntent(intent);
if (!TextUtils.isEmpty(url)) {
- Shell activeView = getActiveShell();
- if (activeView != null) {
- activeView.loadUrl(url);
- }
+// Shell activeView = getActiveShell();
+// if (activeView != null) {
+// activeView.loadUrl(url);
+// }
}
}
@@ -188,14 +183,14 @@ public class ContentShellActivity extends Activity {
protected void onStart() {
super.onStart();
- ContentViewCore contentViewCore = getActiveContentViewCore();
- if (contentViewCore != null) contentViewCore.onShow();
+// ContentViewCore contentViewCore = getActiveContentViewCore();
+// if (contentViewCore != null) contentViewCore.onShow();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
- mWindowAndroid.onActivityResult(requestCode, resultCode, data);
+// mWindowAndroid.onActivityResult(requestCode, resultCode, data);
}
@Override
@@ -217,36 +212,20 @@ public class ContentShellActivity extends Activity {
}
/**
- * @return The {@link ShellManager} configured for the activity or null if it has not been
- * created yet.
- */
- public ShellManager getShellManager() {
- return mShellManager;
- }
-
- /**
* @return The currently visible {@link Shell} or null if one is not showing.
*/
public Shell getActiveShell() {
- return mShellManager != null ? mShellManager.getActiveShell() : 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;
- }
-
- /**
- * @return The {@link WebContents} owned by the currently visible {@link Shell} or null if
- * one is not showing.
- */
- public WebContents getActiveWebContents() {
- Shell shell = getActiveShell();
- return shell != null ? shell.getWebContents() : null;
- }
+ return null;
+ //return mShellManager != null ? mShellManager.getActiveShell() : null;
+ }
+
+// /**
+// * @return The {@link WebContents} owned by the currently visible {@link Shell} or null if
+// * one is not showing.
+// */
+// public WebContents getActiveWebContents() {
+// Shell shell = getActiveShell();
+// return shell != null ? shell.getWebContents() : null;
+// }
}

Powered by Google App Engine
This is Rietveld 408576698