13c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon/* 23c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * Copyright (C) 2012 The Android Open Source Project 33c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * 43c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * Licensed under the Apache License, Version 2.0 (the "License"); 53c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * you may not use this file except in compliance with the License. 63c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * You may obtain a copy of the License at 73c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * 83c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * http://www.apache.org/licenses/LICENSE-2.0 93c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * 103c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * Unless required by applicable law or agreed to in writing, software 113c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * distributed under the License is distributed on an "AS IS" BASIS, 123c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * See the License for the specific language governing permissions and 143c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * limitations under the License. 153c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon */ 163c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon 173c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixonpackage android.webkit; 183c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon 1999c12e8d5f12f239c28644a837937810299e5e3fBen Murdochimport android.content.Context; 2099c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch 213c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon/** 223c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * This is the main entry-point into the WebView back end implementations, which the WebView 233c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * proxy class uses to instantiate all the other objects as needed. The backend must provide an 243c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * implementation of this interface, and make it available to the WebView via mechanism TBD. 253c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * @hide 263c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon */ 273c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixonpublic interface WebViewFactoryProvider { 283c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon /** 293c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * This Interface provides glue for implementing the backend of WebView static methods which 303c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * cannot be implemented in-situ in the proxy class. 313c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon */ 323c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon interface Statics { 333c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon /** 343c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * Implements the API method: 353c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * {@link android.webkit.WebView#findAddress(String)} 363c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon */ 373c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon String findAddress(String addr); 383c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon 393c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon /** 403c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * Implements the API methods: 413c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * {@link android.webkit.WebView#enablePlatformNotifications()} 423c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon * {@link android.webkit.WebView#disablePlatformNotifications()} 433c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon */ 443c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon void setPlatformNotificationsEnabled(boolean enable); 45951fcabef694ce3a78c1e7a8d03a27bd337db021Jonathan Dixon 46951fcabef694ce3a78c1e7a8d03a27bd337db021Jonathan Dixon /** 47951fcabef694ce3a78c1e7a8d03a27bd337db021Jonathan Dixon * Implements the API method: 48951fcabef694ce3a78c1e7a8d03a27bd337db021Jonathan Dixon * {@link android.webkit.WebSettings#getDefaultUserAgent(Context) } 49951fcabef694ce3a78c1e7a8d03a27bd337db021Jonathan Dixon */ 50951fcabef694ce3a78c1e7a8d03a27bd337db021Jonathan Dixon String getDefaultUserAgent(Context context); 513c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon } 52d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon 53d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon Statics getStatics(); 54d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon 55d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon /** 56d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * Construct a new WebViewProvider. 57d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * @param webView the WebView instance bound to this implementation instance. Note it will not 58d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * necessarily be fully constructed at the point of this call: defer real initialization to 59d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * WebViewProvider.init(). 60d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * @param privateAccess provides access into WebView internal methods. 61d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon */ 62d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon WebViewProvider createWebView(WebView webView, WebView.PrivateAccess privateAccess); 63d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon 64d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon /** 65d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * Gets the singleton GeolocationPermissions instance for this WebView implementation. The 66d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * implementation must return the same instance on subsequent calls. 67d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * @return the single GeolocationPermissions instance. 68d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon */ 69d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon GeolocationPermissions getGeolocationPermissions(); 70d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon 71d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon /** 72d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * Gets the singleton CookieManager instance for this WebView implementation. The 73d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * implementation must return the same instance on subsequent calls. 7499c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * 7599c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * @return the singleton CookieManager instance 76d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon */ 77d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon CookieManager getCookieManager(); 78d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon 79d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon /** 80d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * Gets the singleton WebIconDatabase instance for this WebView implementation. The 81d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * implementation must return the same instance on subsequent calls. 8299c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * 8399c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * @return the singleton WebIconDatabase instance 84d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon */ 85d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon WebIconDatabase getWebIconDatabase(); 86d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon 87d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon /** 88d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * Gets the singleton WebStorage instance for this WebView implementation. The 89d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon * implementation must return the same instance on subsequent calls. 9099c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * 9199c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * @return the singleton WebStorage instance 92d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon */ 93d3101b1d300f5942fdb7dfa323dc8830c4edc007Jonathan Dixon WebStorage getWebStorage(); 9499c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch 9599c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch /** 9699c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * Gets the singleton WebViewDatabase instance for this WebView implementation. The 9799c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * implementation must return the same instance on subsequent calls. 9899c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * 9999c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch * @return the singleton WebViewDatabase instance 10099c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch */ 10199c12e8d5f12f239c28644a837937810299e5e3fBen Murdoch WebViewDatabase getWebViewDatabase(Context context); 1023c90952036a5ff7ddb2946c643f1a0bf1c31d53aJonathan Dixon} 103