| 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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace content { | 25 namespace content { |
| 26 class Compositor; | 26 class Compositor; |
| 27 class WebContents; | 27 class WebContents; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace android_webview { | 30 namespace android_webview { |
| 31 | 31 |
| 32 class AwContentsContainer; | 32 class AwContentsContainer; |
| 33 class AwRenderViewHostExt; | 33 class AwRenderViewHostExt; |
| 34 class AwWebContentsDelegate; | 34 class AwWebContentsDelegate; |
| 35 class AwWebContentsViewDelegate; |
| 35 | 36 |
| 36 // Native side of java-class of same name. | 37 // Native side of java-class of same name. |
| 37 // Provides the ownership of and access to browser components required for | 38 // Provides the ownership of and access to browser components required for |
| 38 // WebView functionality; analogous to chrome's TabContents, but with a | 39 // WebView functionality; analogous to chrome's TabContents, but with a |
| 39 // level of indirection provided by the AwContentsContainer abstraction. | 40 // level of indirection provided by the AwContentsContainer abstraction. |
| 40 class AwContents : public FindHelper::Listener, | 41 class AwContents : public FindHelper::Listener, |
| 41 public content::Compositor::Client { | 42 public content::Compositor::Client { |
| 42 public: | 43 public: |
| 43 // Returns the AwContents instance associated with |web_contents|, or NULL. | 44 // Returns the AwContents instance associated with |web_contents|, or NULL. |
| 44 static AwContents* FromWebContents(content::WebContents* web_contents); | 45 static AwContents* FromWebContents(content::WebContents* web_contents); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 int match_count, | 110 int match_count, |
| 110 bool finished) OVERRIDE; | 111 bool finished) OVERRIDE; |
| 111 | 112 |
| 112 // content::Compositor::Client implementation. | 113 // content::Compositor::Client implementation. |
| 113 virtual void ScheduleComposite() OVERRIDE; | 114 virtual void ScheduleComposite() OVERRIDE; |
| 114 virtual void OnSwapBuffersCompleted() OVERRIDE; | 115 virtual void OnSwapBuffersCompleted() OVERRIDE; |
| 115 | 116 |
| 116 void SetPendingWebContentsForPopup(scoped_ptr<content::WebContents> pending); | 117 void SetPendingWebContentsForPopup(scoped_ptr<content::WebContents> pending); |
| 117 jint ReleasePopupWebContents(JNIEnv* env, jobject obj); | 118 jint ReleasePopupWebContents(JNIEnv* env, jobject obj); |
| 118 | 119 |
| 120 base::android::ScopedJavaLocalRef<jobject> CreateAwWebContentsViewDelegate(); |
| 121 |
| 119 private: | 122 private: |
| 120 void Invalidate(); | 123 void Invalidate(); |
| 121 void SetWebContents(content::WebContents* web_contents); | 124 void SetWebContents(content::WebContents* web_contents); |
| 122 | 125 |
| 123 JavaObjectWeakGlobalRef java_ref_; | 126 JavaObjectWeakGlobalRef java_ref_; |
| 124 scoped_ptr<content::WebContents> web_contents_; | 127 scoped_ptr<content::WebContents> web_contents_; |
| 125 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 128 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 126 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 129 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 127 scoped_ptr<FindHelper> find_helper_; | 130 scoped_ptr<FindHelper> find_helper_; |
| 128 scoped_ptr<content::Compositor> compositor_; | 131 scoped_ptr<content::Compositor> compositor_; |
| 129 // State to track if the view is visible, and if the compositor knows yet. | 132 // State to track if the view is visible, and if the compositor knows yet. |
| 130 bool view_visible_; | 133 bool view_visible_; |
| 131 bool compositor_visible_; | 134 bool compositor_visible_; |
| 132 bool is_composite_pending_; | 135 bool is_composite_pending_; |
| 133 scoped_ptr<content::WebContents> pending_contents_; | 136 scoped_ptr<content::WebContents> pending_contents_; |
| 134 | 137 |
| 135 DISALLOW_COPY_AND_ASSIGN(AwContents); | 138 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 bool RegisterAwContents(JNIEnv* env); | 141 bool RegisterAwContents(JNIEnv* env); |
| 139 | 142 |
| 140 } // namespace android_webview | 143 } // namespace android_webview |
| 141 | 144 |
| 142 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 145 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |