| 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 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 class Compositor; | 35 class Compositor; |
| 36 class WebContents; | 36 class WebContents; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace android_webview { | 39 namespace android_webview { |
| 40 | 40 |
| 41 class AwContentsContainer; | 41 class AwContentsContainer; |
| 42 class AwContentsClientBridge; |
| 42 class AwWebContentsDelegate; | 43 class AwWebContentsDelegate; |
| 43 | 44 |
| 44 // Native side of java-class of same name. | 45 // Native side of java-class of same name. |
| 45 // Provides the ownership of and access to browser components required for | 46 // Provides the ownership of and access to browser components required for |
| 46 // WebView functionality; analogous to chrome's TabContents, but with a | 47 // WebView functionality; analogous to chrome's TabContents, but with a |
| 47 // level of indirection provided by the AwContentsContainer abstraction. | 48 // level of indirection provided by the AwContentsContainer abstraction. |
| 48 class AwContents : public FindHelper::Listener, | 49 class AwContents : public FindHelper::Listener, |
| 49 public IconHelper::Listener, | 50 public IconHelper::Listener, |
| 50 public content::Compositor::Client, | 51 public content::Compositor::Client, |
| 51 public AwRenderViewHostExt::Client { | 52 public AwRenderViewHostExt::Client { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 jint ReleasePopupWebContents(JNIEnv* env, jobject obj); | 172 jint ReleasePopupWebContents(JNIEnv* env, jobject obj); |
| 172 | 173 |
| 173 // AwRenderViewHostExt::Client implementation. | 174 // AwRenderViewHostExt::Client implementation. |
| 174 virtual void OnPictureUpdated(int process_id, int render_view_id) OVERRIDE; | 175 virtual void OnPictureUpdated(int process_id, int render_view_id) OVERRIDE; |
| 175 | 176 |
| 176 // Returns the latest locally available picture if any. | 177 // Returns the latest locally available picture if any. |
| 177 // If none is available will synchronously request the latest one | 178 // If none is available will synchronously request the latest one |
| 178 // and block until the result is received. | 179 // and block until the result is received. |
| 179 skia::RefPtr<SkPicture> GetLastCapturedPicture(); | 180 skia::RefPtr<SkPicture> GetLastCapturedPicture(); |
| 180 | 181 |
| 182 AwContentsClientBridge* get_aw_contents_client_bridge(); |
| 183 void set_aw_contents_client_bridge(AwContentsClientBridge* bridge); |
| 184 |
| 181 private: | 185 private: |
| 182 void Invalidate(); | 186 void Invalidate(); |
| 183 void SetWebContents(content::WebContents* web_contents); | 187 void SetWebContents(content::WebContents* web_contents); |
| 184 void SetCompositorVisibility(bool visible); | 188 void SetCompositorVisibility(bool visible); |
| 185 void ResetCompositor(); | 189 void ResetCompositor(); |
| 186 void AttachLayerTree(); | 190 void AttachLayerTree(); |
| 187 bool RenderSW(SkCanvas* canvas); | 191 bool RenderSW(SkCanvas* canvas); |
| 188 bool RenderPicture(SkCanvas* canvas); | 192 bool RenderPicture(SkCanvas* canvas); |
| 189 | 193 |
| 190 JavaObjectWeakGlobalRef java_ref_; | 194 JavaObjectWeakGlobalRef java_ref_; |
| 191 scoped_ptr<content::WebContents> web_contents_; | 195 scoped_ptr<content::WebContents> web_contents_; |
| 196 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; |
| 192 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 197 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 193 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 198 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 194 scoped_ptr<FindHelper> find_helper_; | 199 scoped_ptr<FindHelper> find_helper_; |
| 195 scoped_ptr<IconHelper> icon_helper_; | 200 scoped_ptr<IconHelper> icon_helper_; |
| 196 scoped_ptr<content::WebContents> pending_contents_; | 201 scoped_ptr<content::WebContents> pending_contents_; |
| 197 | 202 |
| 198 // GURL is supplied by the content layer as requesting frame. | 203 // GURL is supplied by the content layer as requesting frame. |
| 199 // Callback is supplied by the content layer, and is invoked with the result | 204 // Callback is supplied by the content layer, and is invoked with the result |
| 200 // from the permission prompt. | 205 // from the permission prompt. |
| 201 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 206 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 220 EGLContext last_frame_context_; | 225 EGLContext last_frame_context_; |
| 221 | 226 |
| 222 DISALLOW_COPY_AND_ASSIGN(AwContents); | 227 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 223 }; | 228 }; |
| 224 | 229 |
| 225 bool RegisterAwContents(JNIEnv* env); | 230 bool RegisterAwContents(JNIEnv* env); |
| 226 | 231 |
| 227 } // namespace android_webview | 232 } // namespace android_webview |
| 228 | 233 |
| 229 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 234 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |