diff options
author | ajith.v <ajith.v@samsung.com> | 2014-09-13 06:26:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-13 13:28:27 +0000 |
commit | 7f5d0b808652fe088a46631948d3deea164fd677 (patch) | |
tree | 8a67b1310fe4d0dbab4e21796adbbcc7bd8a561b /android_webview/test | |
parent | b6ffa66987678f2b7a3c3be79a5fb27d27cd521c (diff) | |
download | chromium_src-7f5d0b808652fe088a46631948d3deea164fd677.zip chromium_src-7f5d0b808652fe088a46631948d3deea164fd677.tar.gz chromium_src-7f5d0b808652fe088a46631948d3deea164fd677.tar.bz2 |
Removing ContentViewCore dependencies from few functions which acts as direct wrapper to WebContents
It's a follow up patch to https://codereview.chromium.org/414423002/. We already restructured WebContents
functionalities from ContentViewCore. In this patch we are removing unwanted ContentViewCore methods,
so that ContentViewCore stake holders can directly call these methods.
BUG=398263
Review URL: https://codereview.chromium.org/481803004
Cr-Commit-Position: refs/heads/master@{#294746}
Diffstat (limited to 'android_webview/test')
-rw-r--r-- | android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java | 20 |
1 files changed, 13 insertions, 7 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 af31b56..8ed513f 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 @@ -37,6 +37,8 @@ import org.chromium.android_webview.AwSettings; import org.chromium.android_webview.test.AwTestContainerView; import org.chromium.android_webview.test.NullContentsClient; import org.chromium.content_public.browser.LoadUrlParams; +import org.chromium.content_public.browser.NavigationController; +import org.chromium.content_public.browser.WebContents; /** * This is a lightweight activity for tests that only require WebView functionality. @@ -47,6 +49,8 @@ public class AwShellActivity extends Activity { private AwBrowserContext mBrowserContext; private AwDevToolsServer mDevToolsServer; private AwTestContainerView mAwTestContainerView; + private WebContents mWebContents; + private NavigationController mNavigationController; private EditText mUrlTextView; private ImageButton mPrevButton; private ImageButton mNextButton; @@ -59,6 +63,8 @@ public class AwShellActivity extends Activity { mAwTestContainerView = createAwTestContainerView(); + mWebContents = mAwTestContainerView.getContentViewCore().getWebContents(); + mNavigationController = mWebContents.getNavigationController(); LinearLayout contentContainer = (LinearLayout) findViewById(R.id.content_container); mAwTestContainerView.setLayoutParams(new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1f)); @@ -182,7 +188,7 @@ public class AwShellActivity extends Activity { mNextButton.setVisibility(hasFocus ? View.GONE : View.VISIBLE); mPrevButton.setVisibility(hasFocus ? View.GONE : View.VISIBLE); if (!hasFocus) { - mUrlTextView.setText(mAwTestContainerView.getContentViewCore().getUrl()); + mUrlTextView.setText(mWebContents.getUrl()); } } }); @@ -193,8 +199,8 @@ public class AwShellActivity extends Activity { mPrevButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (mAwTestContainerView.getContentViewCore().canGoBack()) { - mAwTestContainerView.getContentViewCore().goBack(); + if (mNavigationController.canGoBack()) { + mNavigationController.goBack(); } } }); @@ -203,8 +209,8 @@ public class AwShellActivity extends Activity { mNextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (mAwTestContainerView.getContentViewCore().canGoForward()) { - mAwTestContainerView.getContentViewCore().goForward(); + if (mNavigationController.canGoForward()) { + mNavigationController.goForward(); } } }); @@ -213,8 +219,8 @@ public class AwShellActivity extends Activity { @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { - if (mAwTestContainerView.getContentViewCore().canGoBack()) { - mAwTestContainerView.getContentViewCore().goBack(); + if (mNavigationController.canGoBack()) { + mNavigationController.goBack(); return true; } } |