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

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

Issue 1070563005: [Android WebView] Upstream WebViewShell to chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix copyright year Created 5 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.webview_shell;
6
7 import android.app.Activity;
8 import android.content.Intent;
9 import android.os.Bundle;
10 import android.webkit.CookieManager;
11 import android.webkit.WebView;
12 import android.webkit.WebViewClient;
13
14 /**
15 * This activity is designed for Android Jank testing of WebView. It takes a URL as an argument, and
16 * displays the page ready for the Jank tester to test scrolling etc.
17 */
18 public class JankActivity extends Activity {
19
20 @Override
21 public void onCreate(Bundle savedInstanceState) {
22 super.onCreate(savedInstanceState);
23 getWindow().setTitle(
24 getResources().getString(R.string.title_activity_jank));
25 setContentView(R.layout.activity_webview);
26
27 WebView webView = (WebView) findViewById(R.id.webview);
28 CookieManager.setAcceptFileSchemeCookies(true);
29
30 webView.setWebViewClient(new WebViewClient() {
31 @Override
32 public boolean shouldOverrideUrlLoading(WebView webView, String url) {
33 return false;
34 }
35 });
36
37 String url = getUrlFromIntent(getIntent());
38 webView.loadUrl(url);
39 }
40
41 private static String getUrlFromIntent(Intent intent) {
42 return intent != null ? intent.getDataString() : null;
43 }
44
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698