Commit a550da81 authored by p.sergey's avatar p.sergey Committed by Commit bot

Enable zoom and make contents fit into viewport.

Make android webview shell behaviour to be like chrome shell: enable
zoom and fit we page contents into viewport.

BUG=n/a

Review URL: https://codereview.chromium.org/872363005

Cr-Commit-Position: refs/heads/master@{#314305}
parent 20b6cf4f
...@@ -149,9 +149,16 @@ public class AwShellActivity extends Activity { ...@@ -149,9 +149,16 @@ public class AwShellActivity extends Activity {
mBrowserContext = new AwBrowserContext(sharedPreferences); mBrowserContext = new AwBrowserContext(sharedPreferences);
} }
final AwSettings awSettings = new AwSettings(this /*context*/, final AwSettings awSettings = new AwSettings(this /*context*/,
false /*isAccessFromFileURLsGrantedByDefault*/, true /*supportsLegacyQuirks*/); false /*isAccessFromFileURLsGrantedByDefault*/, false /*supportsLegacyQuirks*/);
// Required for WebGL conformance tests. // Required for WebGL conformance tests.
awSettings.setMediaPlaybackRequiresUserGesture(false); awSettings.setMediaPlaybackRequiresUserGesture(false);
// Allow zoom and fit contents to screen
awSettings.setBuiltInZoomControls(true);
awSettings.setDisplayZoomControls(false);
awSettings.setUseWideViewPort(true);
awSettings.setLoadWithOverviewMode(true);
awSettings.setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING);
testContainerView.initialize(new AwContents(mBrowserContext, testContainerView, testContainerView.initialize(new AwContents(mBrowserContext, testContainerView,
testContainerView.getContext(), testContainerView.getInternalAccessDelegate(), testContainerView.getContext(), testContainerView.getInternalAccessDelegate(),
testContainerView.getNativeGLDelegate(), awContentsClient, awSettings)); testContainerView.getNativeGLDelegate(), awContentsClient, awSettings));
...@@ -182,9 +189,9 @@ public class AwShellActivity extends Activity { ...@@ -182,9 +189,9 @@ public class AwShellActivity extends Activity {
mUrlTextView.setOnEditorActionListener(new OnEditorActionListener() { mUrlTextView.setOnEditorActionListener(new OnEditorActionListener() {
@Override @Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null || if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null
event.getKeyCode() != KeyEvent.KEYCODE_ENTER || || event.getKeyCode() != KeyEvent.KEYCODE_ENTER
event.getAction() != KeyEvent.ACTION_DOWN)) { || event.getAction() != KeyEvent.ACTION_DOWN)) {
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment