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

Side by Side Diff: android_webview/tools/WebViewTelemetryShell/src/org/chromium/telemetry_shell/JankActivity.java

Issue 443953002: Move WebViewShell from Android to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update package name in another place. Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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.telemetry_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.
16 * It takes a URL as an argument, and displays the page ready for the Jank teste r to test
17 * scrolling etc.
18 */
19 public class JankActivity extends Activity {
20
21 @Override
22 public void onCreate(Bundle savedInstanceState) {
23 super.onCreate(savedInstanceState);
24 getWindow().setTitle(
25 getResources().getString(R.string.title_activity_jank));
26 setContentView(R.layout.activity_telemetry);
27
28 WebView webView = (WebView) findViewById(R.id.webview);
29 CookieManager.setAcceptFileSchemeCookies(true);
30
31 webView.setWebViewClient(new WebViewClient() {
32 @Override
33 public boolean shouldOverrideUrlLoading(WebView webView, String url) {
34 return false;
35 }
36 });
37
38 String url = getUrlFromIntent(getIntent());
39 webView.loadUrl(url);
40 }
41
42 private static String getUrlFromIntent(Intent intent) {
43 return intent != null ? intent.getDataString() : null;
44 }
45
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698