diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 23:40:32 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 23:40:32 +0000 |
commit | 14a2df0d0dee8e5b861e6f9a13df932a39a05f61 (patch) | |
tree | dac870b1c6aa5827e177252f9e5b663bbdb2d436 /android_webview/test | |
parent | f1b149409ab54866b1a1e619ab9d59dc1d8f808d (diff) | |
download | chromium_src-14a2df0d0dee8e5b861e6f9a13df932a39a05f61.zip chromium_src-14a2df0d0dee8e5b861e6f9a13df932a39a05f61.tar.gz chromium_src-14a2df0d0dee8e5b861e6f9a13df932a39a05f61.tar.bz2 |
Fix Popup window flow to work with synchronous compositor gfx mode
This switches around the object lifetimes, so WebContents and AwContents
(native) have identical lifetimes, but now the native AwContents may
exist before its java counterpart, and in the popup flow the java
object may switch from its default peer instance to acquire the pop-up
AwContents/WebContents instead.
Additionally, makes some simplifications to the way AwSettings is created
and also fixes a potential leak (the native instance was never deleted if
destroy() was not called).
NOTRY=true
BUG=245801
Review URL: https://chromiumcodereview.appspot.com/16843008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/test')
-rw-r--r-- | android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java index e2d6dcf..5646bc1 100644 --- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java +++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java @@ -39,6 +39,7 @@ import org.chromium.content.browser.LoadUrlParams; public class AwShellActivity extends Activity { private final static String PREFERENCES_NAME = "AwShellPrefs"; private final static String INITIAL_URL = "about:blank"; + private AwBrowserContext mBrowserContext; private AwTestContainerView mAwTestContainerView; private EditText mUrlTextView; private ImageButton mPrevButton; @@ -83,11 +84,12 @@ public class AwShellActivity extends Activity { SharedPreferences sharedPreferences = getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE); - AwBrowserContext browserContext = new AwBrowserContext(sharedPreferences); - - testContainerView.initialize(new AwContents(browserContext, testContainerView, + if (mBrowserContext == null) { + mBrowserContext = new AwBrowserContext(sharedPreferences, false); + } + testContainerView.initialize(new AwContents(mBrowserContext, testContainerView, testContainerView.getInternalAccessDelegate(), - awContentsClient, false)); + awContentsClient)); testContainerView.getAwContents().getSettings().setJavaScriptEnabled(true); return testContainerView; } |