OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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.chrome.browser.webapps; | |
6 | |
7 import android.content.Intent; | |
8 | |
9 import org.chromium.chrome.browser.ShortcutHelper; | |
10 import org.chromium.content_public.browser.LoadUrlParams; | |
11 import org.chromium.ui.base.PageTransition; | |
12 | |
13 /** | |
14 * TODO: Insert description here. (generated by hanxi) | |
gone
2016/05/25 21:50:14
Actually insert this description.
Xi Han
2016/05/26 17:23:36
Sorry for the missing description. Added.
| |
15 */ | |
16 public class WebApkActivity extends WebappActivity { | |
17 @Override | |
18 protected void onNewIntent(Intent intent) { | |
19 super.onNewIntent(intent); | |
20 // We could bring a WebAPK hosted WebappActivity to foreground and navig ate it to a | |
21 // different URL. For example, WebAPK "foo" is launched and navigates to | |
22 // "www.foo.com/foo". In Chrome, user clicks a link "www.foo.com/bar" in Google search | |
23 // results. After clicking the link, WebAPK "foo" is brought to foregrou nd, and | |
24 // loads the page of "www.foo.com/bar" at the same time. | |
25 // The extra {@link ShortcutHelper.EXTRA_URL} provides the URL that the WebAPK will | |
26 // navigate to. | |
27 String overrideUrl = intent.getStringExtra(ShortcutHelper.EXTRA_URL); | |
28 if (overrideUrl != null && isInitialized() | |
29 && !overrideUrl.equals(getActivityTab().getUrl())) { | |
30 getActivityTab().loadUrl( | |
31 new LoadUrlParams(overrideUrl, PageTransition.AUTO_TOPLEVEL) ); | |
32 } | |
33 } | |
34 | |
35 @Override | |
36 protected void initializeSplashScreenWidgets(final int backgroundColor) { | |
37 // TODO(hanxi): Removes this function and use {@link WebApkActivity}'s i mplementation | |
38 // when WebAPKs are registered in WebappRegistry. | |
39 initializeSplashScreenWidgets(backgroundColor, null); | |
40 } | |
41 } | |
OLD | NEW |