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

Side by Side Diff: android_webview/tools/WebViewShell/src/org/chromium/webview_shell/TelemetryActivity.java

Issue 1471153002: Enable DOM storage in WebView for Telemetry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.webview_shell; 5 package org.chromium.webview_shell;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.os.Bundle; 9 import android.os.Bundle;
10 import android.webkit.CookieManager; 10 import android.webkit.CookieManager;
(...skipping 10 matching lines...) Expand all
21 public void onCreate(Bundle savedInstanceState) { 21 public void onCreate(Bundle savedInstanceState) {
22 super.onCreate(savedInstanceState); 22 super.onCreate(savedInstanceState);
23 getWindow().setTitle( 23 getWindow().setTitle(
24 getResources().getString(R.string.title_activity_telemetry)); 24 getResources().getString(R.string.title_activity_telemetry));
25 setContentView(R.layout.activity_webview); 25 setContentView(R.layout.activity_webview);
26 26
27 WebView webView = (WebView) findViewById(R.id.webview); 27 WebView webView = (WebView) findViewById(R.id.webview);
28 CookieManager.setAcceptFileSchemeCookies(true); 28 CookieManager.setAcceptFileSchemeCookies(true);
29 WebSettings settings = webView.getSettings(); 29 WebSettings settings = webView.getSettings();
30 settings.setJavaScriptEnabled(true); 30 settings.setJavaScriptEnabled(true);
31 settings.setUseWideViewPort(true);
32 settings.setLoadWithOverviewMode(true);
33 settings.setDomStorageEnabled(true);
31 34
32 Intent intent = getIntent(); 35 Intent intent = getIntent();
33 String userAgentString = intent.getStringExtra("userAgent"); 36 String userAgentString = intent.getStringExtra("userAgent");
34 if (userAgentString != null) { 37 if (userAgentString != null) {
35 settings.setUserAgentString(userAgentString); 38 settings.setUserAgentString(userAgentString);
36 } 39 }
37 40
38 webView.setWebViewClient(new WebViewClient() { 41 webView.setWebViewClient(new WebViewClient() {
39 @Override 42 @Override
40 public boolean shouldOverrideUrlLoading(WebView webView, String url) { 43 public boolean shouldOverrideUrlLoading(WebView webView, String url) {
41 return false; 44 return false;
42 } 45 }
43 }); 46 });
44 47
45 webView.loadUrl("about:blank"); 48 webView.loadUrl("about:blank");
46 } 49 }
47 } 50 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698