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 import android.content.Context; |
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; |
11 import org.chromium.chrome.browser.tab.Tab; | 11 import org.chromium.chrome.browser.tab.Tab; |
12 | 12 |
13 import java.util.List; | 13 import java.util.List; |
14 | 14 |
15 /** | 15 /** |
16 * A delegate for the class responsible for navigating to external applications
from Chrome. Used | 16 * A delegate for the class responsible for navigating to external applications
from Chrome. Used |
17 * by {@link ExternalNavigationHandler}. | 17 * by {@link ExternalNavigationHandler}. |
18 */ | 18 */ |
19 interface ExternalNavigationDelegate { | 19 interface ExternalNavigationDelegate { |
20 /** | 20 /** |
21 * Get the list of component name of activities which can resolve |intent|. | 21 * Get the list of component name of activities which can resolve |intent|. |
22 */ | 22 */ |
23 List<ResolveInfo> queryIntentActivities(Intent intent); | 23 List<ResolveInfo> queryIntentActivities(Intent intent); |
24 | 24 |
25 /** | 25 /** |
| 26 * Get the activity context associated with the delegate |
| 27 */ |
| 28 Context getAssociatedActivityContext(); |
| 29 |
| 30 /** |
26 * Determine if Chrome is the default or only handler for a given intent. If
true, Chrome | 31 * Determine if Chrome is the default or only handler for a given intent. If
true, Chrome |
27 * will handle the intent when started. | 32 * will handle the intent when started. |
28 */ | 33 */ |
29 boolean willChromeHandleIntent(Intent intent); | 34 boolean willChromeHandleIntent(Intent intent); |
30 | 35 |
31 /** | 36 /** |
32 * Search for intent handlers that are specific to this URL aka, specialized
apps like | 37 * Search for intent handlers that are specific to this URL aka, specialized
apps like |
33 * google maps or youtube | 38 * google maps or youtube |
34 */ | 39 */ |
35 boolean isSpecializedHandlerAvailable(List<ResolveInfo> infos); | 40 boolean isSpecializedHandlerAvailable(List<ResolveInfo> infos); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 /** | 127 /** |
123 * @return Default SMS application's package name. Null if there isn't any. | 128 * @return Default SMS application's package name. Null if there isn't any. |
124 */ | 129 */ |
125 String getDefaultSmsPackageName(); | 130 String getDefaultSmsPackageName(); |
126 | 131 |
127 /** | 132 /** |
128 * @return Whether the URL is a file download. | 133 * @return Whether the URL is a file download. |
129 */ | 134 */ |
130 boolean isPdfDownload(String url); | 135 boolean isPdfDownload(String url); |
131 } | 136 } |
OLD | NEW |