| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace content { | 30 namespace content { |
| 31 class WebContents; | 31 class WebContents; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace android_webview { | 34 namespace android_webview { |
| 35 | 35 |
| 36 class AwContentsContainer; | 36 class AwContentsContainer; |
| 37 class AwContentsClientBridge; | 37 class AwContentsClientBridge; |
| 38 class AwPdfExporter; | 38 class AwPdfExporter; |
| 39 class AwWebContentsDelegate; | 39 class AwWebContentsDelegate; |
| 40 class HardwareRenderer; | 40 class HardwareRendererInterface; |
| 41 class PermissionRequestHandler; | 41 class PermissionRequestHandler; |
| 42 | 42 |
| 43 // Native side of java-class of same name. | 43 // Native side of java-class of same name. |
| 44 // Provides the ownership of and access to browser components required for | 44 // Provides the ownership of and access to browser components required for |
| 45 // WebView functionality; analogous to chrome's TabContents, but with a | 45 // WebView functionality; analogous to chrome's TabContents, but with a |
| 46 // level of indirection provided by the AwContentsContainer abstraction. | 46 // level of indirection provided by the AwContentsContainer abstraction. |
| 47 // | 47 // |
| 48 // Object lifetime: | 48 // Object lifetime: |
| 49 // For most purposes the java and native objects can be considered to have | 49 // For most purposes the java and native objects can be considered to have |
| 50 // 1:1 lifetime and relationship. The exception is the java instance that | 50 // 1:1 lifetime and relationship. The exception is the java instance that |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void SetAwAutofillManagerDelegate(jobject delegate); | 209 void SetAwAutofillManagerDelegate(jobject delegate); |
| 210 | 210 |
| 211 void SetJsOnlineProperty(JNIEnv* env, jobject obj, jboolean network_up); | 211 void SetJsOnlineProperty(JNIEnv* env, jobject obj, jboolean network_up); |
| 212 void TrimMemory(JNIEnv* env, jobject obj, jint level, jboolean visible); | 212 void TrimMemory(JNIEnv* env, jobject obj, jint level, jboolean visible); |
| 213 | 213 |
| 214 private: | 214 private: |
| 215 void InitDataReductionProxyIfNecessary(); | 215 void InitDataReductionProxyIfNecessary(); |
| 216 void InitAutofillIfNecessary(bool enabled); | 216 void InitAutofillIfNecessary(bool enabled); |
| 217 | 217 |
| 218 void InitializeHardwareDrawIfNeeded(); | 218 void InitializeHardwareDrawIfNeeded(); |
| 219 void InitializeHardwareDrawOnRenderThread(); | |
| 220 void ReleaseHardwareDrawOnRenderThread(); | |
| 221 | 219 |
| 222 JavaObjectWeakGlobalRef java_ref_; | 220 JavaObjectWeakGlobalRef java_ref_; |
| 223 scoped_ptr<content::WebContents> web_contents_; | 221 scoped_ptr<content::WebContents> web_contents_; |
| 224 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 222 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 225 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; | 223 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; |
| 226 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 224 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 227 scoped_ptr<FindHelper> find_helper_; | 225 scoped_ptr<FindHelper> find_helper_; |
| 228 scoped_ptr<IconHelper> icon_helper_; | 226 scoped_ptr<IconHelper> icon_helper_; |
| 229 scoped_ptr<AwContents> pending_contents_; | 227 scoped_ptr<AwContents> pending_contents_; |
| 230 SharedRendererState shared_renderer_state_; | 228 SharedRendererState shared_renderer_state_; |
| 231 BrowserViewRenderer browser_view_renderer_; | 229 BrowserViewRenderer browser_view_renderer_; |
| 232 scoped_ptr<HardwareRenderer> hardware_renderer_; | 230 scoped_ptr<HardwareRendererInterface> hardware_renderer_; |
| 233 scoped_ptr<AwPdfExporter> pdf_exporter_; | 231 scoped_ptr<AwPdfExporter> pdf_exporter_; |
| 234 scoped_ptr<PermissionRequestHandler> permission_request_handler_; | 232 scoped_ptr<PermissionRequestHandler> permission_request_handler_; |
| 235 | 233 |
| 236 // GURL is supplied by the content layer as requesting frame. | 234 // GURL is supplied by the content layer as requesting frame. |
| 237 // Callback is supplied by the content layer, and is invoked with the result | 235 // Callback is supplied by the content layer, and is invoked with the result |
| 238 // from the permission prompt. | 236 // from the permission prompt. |
| 239 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 237 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
| 240 // The first element in the list is always the currently pending request. | 238 // The first element in the list is always the currently pending request. |
| 241 std::list<OriginCallback> pending_geolocation_prompts_; | 239 std::list<OriginCallback> pending_geolocation_prompts_; |
| 242 | 240 |
| 241 base::Lock render_thread_lock_; |
| 243 GLViewRendererManager::Key renderer_manager_key_; | 242 GLViewRendererManager::Key renderer_manager_key_; |
| 244 | 243 |
| 245 DISALLOW_COPY_AND_ASSIGN(AwContents); | 244 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 246 }; | 245 }; |
| 247 | 246 |
| 248 bool RegisterAwContents(JNIEnv* env); | 247 bool RegisterAwContents(JNIEnv* env); |
| 249 | 248 |
| 250 } // namespace android_webview | 249 } // namespace android_webview |
| 251 | 250 |
| 252 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 251 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |