OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.content.pm.ActivityInfo; | 7 import android.content.pm.ActivityInfo; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.graphics.Picture; | 9 import android.graphics.Picture; |
10 import android.net.http.SslError; | 10 import android.net.http.SslError; |
11 import android.os.Looper; | 11 import android.os.Looper; |
12 import android.os.Message; | 12 import android.os.Message; |
13 import android.view.KeyEvent; | 13 import android.view.KeyEvent; |
14 import android.view.View; | 14 import android.view.View; |
15 import android.webkit.ConsoleMessage; | 15 import android.webkit.ConsoleMessage; |
16 import android.webkit.GeolocationPermissions; | 16 import android.webkit.GeolocationPermissions; |
17 import android.webkit.ValueCallback; | 17 import android.webkit.ValueCallback; |
18 import android.webkit.WebChromeClient; | 18 import android.webkit.WebChromeClient; |
19 | 19 |
20 import org.chromium.android_webview.permission.AwPermissionRequest; | 20 import org.chromium.android_webview.permission.AwPermissionRequest; |
21 import org.chromium.content.browser.ContentViewCore; | 21 import org.chromium.content.browser.ContentViewCore; |
22 import org.chromium.content.browser.WebContentsObserverAndroid; | 22 import org.chromium.content.browser.WebContentsObserverAndroid; |
23 import org.chromium.net.NetError; | 23 import org.chromium.net.NetError; |
24 | 24 |
25 import java.security.Principal; | 25 import java.security.Principal; |
26 import java.util.Map; | |
26 | 27 |
27 /** | 28 /** |
28 * Base-class that an AwContents embedder derives from to receive callbacks. | 29 * Base-class that an AwContents embedder derives from to receive callbacks. |
29 * This extends ContentViewClient, as in many cases we want to pass-thru Content ViewCore | 30 * This extends ContentViewClient, as in many cases we want to pass-thru Content ViewCore |
30 * callbacks right to our embedder, and this setup facilities that. | 31 * callbacks right to our embedder, and this setup facilities that. |
31 * For any other callbacks we need to make transformations of (e.g. adapt parame ters | 32 * For any other callbacks we need to make transformations of (e.g. adapt parame ters |
32 * or perform filtering) we can provide final overrides for methods here, and th en introduce | 33 * or perform filtering) we can provide final overrides for methods here, and th en introduce |
33 * new abstract methods that the our own client must implement. | 34 * new abstract methods that the our own client must implement. |
34 * i.e.: all methods in this class should either be final, or abstract. | 35 * i.e.: all methods in this class should either be final, or abstract. |
35 */ | 36 */ |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 * Parameters for the {@link AwContentsClient#showFileChooser} method. | 139 * Parameters for the {@link AwContentsClient#showFileChooser} method. |
139 */ | 140 */ |
140 public static class FileChooserParams { | 141 public static class FileChooserParams { |
141 public int mode; | 142 public int mode; |
142 public String acceptTypes; | 143 public String acceptTypes; |
143 public String title; | 144 public String title; |
144 public String defaultFilename; | 145 public String defaultFilename; |
145 public boolean capture; | 146 public boolean capture; |
146 } | 147 } |
147 | 148 |
149 /** | |
150 * Parameters for the {@link AwContentsClient#shouldInterceptRequest} method . | |
151 */ | |
152 public static class ShouldInterceptRequestParams { | |
153 // Url of the request. | |
154 public String url; | |
155 // Is this for the main frame or a child iframe? | |
156 public boolean isMainFrame; | |
157 // Was a gesture associated with the request? Don't trust can easily be spoofed. | |
158 public boolean hasUserGesture; | |
159 // Method used (GET/POST/OPTIONS) | |
160 public String method; | |
161 // Headers that would have been sent to server. | |
162 public Map<String, String> headers; | |
benm (inactive)
2014/05/15 17:43:15
call it requestHeaders please
mkosiba (inactive)
2014/06/19 17:54:14
Done.
| |
163 } | |
164 | |
148 public abstract void getVisitedHistory(ValueCallback<String[]> callback); | 165 public abstract void getVisitedHistory(ValueCallback<String[]> callback); |
149 | 166 |
150 public abstract void doUpdateVisitedHistory(String url, boolean isReload); | 167 public abstract void doUpdateVisitedHistory(String url, boolean isReload); |
151 | 168 |
152 public abstract void onProgressChanged(int progress); | 169 public abstract void onProgressChanged(int progress); |
153 | 170 |
154 public abstract InterceptedRequestData shouldInterceptRequest(String url); | 171 public abstract InterceptedRequestData shouldInterceptRequest( |
172 ShouldInterceptRequestParams params); | |
155 | 173 |
156 public abstract boolean shouldOverrideKeyEvent(KeyEvent event); | 174 public abstract boolean shouldOverrideKeyEvent(KeyEvent event); |
157 | 175 |
158 public abstract boolean shouldOverrideUrlLoading(String url); | 176 public abstract boolean shouldOverrideUrlLoading(String url); |
159 | 177 |
160 public abstract void onLoadResource(String url); | 178 public abstract void onLoadResource(String url); |
161 | 179 |
162 public abstract void onUnhandledKeyEvent(KeyEvent event); | 180 public abstract void onUnhandledKeyEvent(KeyEvent event); |
163 | 181 |
164 public abstract boolean onConsoleMessage(ConsoleMessage consoleMessage); | 182 public abstract boolean onConsoleMessage(ConsoleMessage consoleMessage); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 public abstract void onFindResultReceived(int activeMatchOrdinal, int number OfMatches, | 270 public abstract void onFindResultReceived(int activeMatchOrdinal, int number OfMatches, |
253 boolean isDoneCounting); | 271 boolean isDoneCounting); |
254 | 272 |
255 /** | 273 /** |
256 * Called whenever there is a new content picture available. | 274 * Called whenever there is a new content picture available. |
257 * @param picture New picture. | 275 * @param picture New picture. |
258 */ | 276 */ |
259 public abstract void onNewPicture(Picture picture); | 277 public abstract void onNewPicture(Picture picture); |
260 | 278 |
261 } | 279 } |
OLD | NEW |