OLD | NEW |
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.chrome.browser.externalnav; | 5 package org.chromium.chrome.browser.externalnav; |
6 | 6 |
7 import android.content.Intent; | 7 import android.content.Intent; |
8 import android.content.pm.ResolveInfo; | 8 import android.content.pm.ResolveInfo; |
9 | 9 |
10 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler.Overrid
eUrlLoadingResult; | 10 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler.Overrid
eUrlLoadingResult; |
(...skipping 14 matching lines...) Expand all Loading... |
25 /** | 25 /** |
26 * Determine if Chrome is the default or only handler for a given intent. If
true, Chrome | 26 * Determine if Chrome is the default or only handler for a given intent. If
true, Chrome |
27 * will handle the intent when started. | 27 * will handle the intent when started. |
28 */ | 28 */ |
29 boolean willChromeHandleIntent(Intent intent); | 29 boolean willChromeHandleIntent(Intent intent); |
30 | 30 |
31 /** | 31 /** |
32 * Search for intent handlers that are specific to this URL aka, specialized
apps like | 32 * Search for intent handlers that are specific to this URL aka, specialized
apps like |
33 * google maps or youtube | 33 * google maps or youtube |
34 */ | 34 */ |
35 boolean isSpecializedHandlerAvailable(List<ResolveInfo> intent); | 35 boolean isSpecializedHandlerAvailable(List<ResolveInfo> infos); |
36 | 36 |
37 /** | 37 /** |
38 * Returns the number of specialized intent handlers in {@params infos}. Spe
cialized intent | 38 * Returns the number of specialized intent handlers in {@params infos}. Spe
cialized intent |
39 * handlers are intent handlers which handle only a few URLs (e.g. google ma
ps or youtube). | 39 * handlers are intent handlers which handle only a few URLs (e.g. google ma
ps or youtube). |
40 */ | 40 */ |
41 int countSpecializedHandlers(List<ResolveInfo> infos); | 41 int countSpecializedHandlers(List<ResolveInfo> infos); |
42 | 42 |
43 /** | 43 /** |
44 * Returns the package name of the first valid WebAPK in {@link infos}. | 44 * Returns the package name of the first valid WebAPK in {@link infos}. |
45 * @param infos ResolveInfos to search. | 45 * @param infos ResolveInfos to search. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 * @param referrerUrl The HTTP referrer URL. | 99 * @param referrerUrl The HTTP referrer URL. |
100 * @param tab The current tab. | 100 * @param tab The current tab. |
101 * @return OverrideUrlLoadingResult (if the tab has been clobbered, or we're
launching an | 101 * @return OverrideUrlLoadingResult (if the tab has been clobbered, or we're
launching an |
102 * intent.) | 102 * intent.) |
103 */ | 103 */ |
104 OverrideUrlLoadingResult clobberCurrentTab(String url, String referrerUrl, T
ab tab); | 104 OverrideUrlLoadingResult clobberCurrentTab(String url, String referrerUrl, T
ab tab); |
105 | 105 |
106 /** Adds a window id to the intent, if necessary. */ | 106 /** Adds a window id to the intent, if necessary. */ |
107 void maybeSetWindowId(Intent intent); | 107 void maybeSetWindowId(Intent intent); |
108 | 108 |
| 109 /** Adds the package name of a specialized intent handler. */ |
| 110 void maybeRecordAppHandlersInIntent(Intent intent, List<ResolveInfo> info); |
| 111 |
109 /** | 112 /** |
110 * Determine if the Chrome app is in the foreground. | 113 * Determine if the Chrome app is in the foreground. |
111 */ | 114 */ |
112 boolean isChromeAppInForeground(); | 115 boolean isChromeAppInForeground(); |
113 | 116 |
114 /** | 117 /** |
115 * Check if Chrome is running in document mode. | 118 * Check if Chrome is running in document mode. |
116 */ | 119 */ |
117 boolean isDocumentMode(); | 120 boolean isDocumentMode(); |
118 | 121 |
119 /** | 122 /** |
120 * @return Default SMS application's package name. Null if there isn't any. | 123 * @return Default SMS application's package name. Null if there isn't any. |
121 */ | 124 */ |
122 String getDefaultSmsPackageName(); | 125 String getDefaultSmsPackageName(); |
123 | 126 |
124 /** | 127 /** |
125 * @return Whether the URL is a file download. | 128 * @return Whether the URL is a file download. |
126 */ | 129 */ |
127 boolean isPdfDownload(String url); | 130 boolean isPdfDownload(String url); |
128 } | 131 } |
OLD | NEW |