OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.ActivityManager; | 7 import android.app.ActivityManager; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.content.pm.ApplicationInfo; | 10 import android.content.pm.ApplicationInfo; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 /** | 340 /** |
341 * Creates an intent with mostly empty parameters for launching a web app on
the homescreen. | 341 * Creates an intent with mostly empty parameters for launching a web app on
the homescreen. |
342 * @param id Id of the web app. | 342 * @param id Id of the web app. |
343 * @param url Url of the web app. | 343 * @param url Url of the web app. |
344 * @return the Intent | 344 * @return the Intent |
345 * This method must not be called on the UI thread. | 345 * This method must not be called on the UI thread. |
346 */ | 346 */ |
347 public static Intent createWebappShortcutIntentForTesting(String id, String
url) { | 347 public static Intent createWebappShortcutIntentForTesting(String id, String
url) { |
348 assert !ThreadUtils.runningOnUiThread(); | 348 assert !ThreadUtils.runningOnUiThread(); |
349 return createWebappShortcutIntent(id, null, url, getScopeFromUrl(url), n
ull, null, null, | 349 return createWebappShortcutIntent(id, null, url, getScopeFromUrl(url), n
ull, null, null, |
350 WEBAPP_SHORTCUT_VERSION, WebDisplayMode.kStandalone, 0, 0, 0, fa
lse); | 350 WEBAPP_SHORTCUT_VERSION, WebDisplayMode.STANDALONE, 0, 0, 0, fal
se); |
351 } | 351 } |
352 | 352 |
353 /** | 353 /** |
354 * Shortcut intent for icon on home screen. | 354 * Shortcut intent for icon on home screen. |
355 * @param url Url of the shortcut. | 355 * @param url Url of the shortcut. |
356 * @return Intent for onclick action of the shortcut. | 356 * @return Intent for onclick action of the shortcut. |
357 */ | 357 */ |
358 public static Intent createShortcutIntent(String url) { | 358 public static Intent createShortcutIntent(String url) { |
359 Intent shortcutIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | 359 Intent shortcutIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
360 shortcutIntent.putExtra(REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB, true); | 360 shortcutIntent.putExtra(REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB, true); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 } | 732 } |
733 return array; | 733 return array; |
734 } | 734 } |
735 | 735 |
736 private static native void nativeOnWebappDataStored(long callbackPointer); | 736 private static native void nativeOnWebappDataStored(long callbackPointer); |
737 private static native void nativeOnWebApksRetrieved(long callbackPointer, St
ring[] names, | 737 private static native void nativeOnWebApksRetrieved(long callbackPointer, St
ring[] names, |
738 String[] shortNames, String[] packageName, int[] shellApkVersions, i
nt[] versionCodes, | 738 String[] shortNames, String[] packageName, int[] shellApkVersions, i
nt[] versionCodes, |
739 String[] uris, String[] scopes, String[] manifestUrls, String[] mani
festStartUrls, | 739 String[] uris, String[] scopes, String[] manifestUrls, String[] mani
festStartUrls, |
740 int[] displayModes, int[] orientations, long[] themeColors, long[] b
ackgroundColors); | 740 int[] displayModes, int[] orientations, long[] themeColors, long[] b
ackgroundColors); |
741 } | 741 } |
OLD | NEW |