| 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 | 9 |
| 10 #include "base/android/jni_helper.h" | 10 #include "base/android/jni_helper.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 | 12 |
| 13 class TabContents; | 13 class TabContents; |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class WebContents; | 16 class WebContents; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace android_webview { | 19 namespace android_webview { |
| 20 | 20 |
| 21 class AwContentsContainer; | 21 class AwContentsContainer; |
| 22 class AwRenderViewHostExt; |
| 22 class AwWebContentsDelegate; | 23 class AwWebContentsDelegate; |
| 23 | 24 |
| 24 // Native side of java-class of same name. | 25 // Native side of java-class of same name. |
| 25 // Provides the ownership of and access to browser components required for | 26 // Provides the ownership of and access to browser components required for |
| 26 // WebView functionality; analogous to chrome's TabContents, but with a | 27 // WebView functionality; analogous to chrome's TabContents, but with a |
| 27 // level of indirection provided by the AwContentsContainer abstraction. | 28 // level of indirection provided by the AwContentsContainer abstraction. |
| 28 class AwContents { | 29 class AwContents { |
| 29 public: | 30 public: |
| 30 AwContents(JNIEnv* env, | 31 AwContents(JNIEnv* env, |
| 31 jobject obj, | 32 jobject obj, |
| 32 jobject web_contents_delegate, | 33 jobject web_contents_delegate, |
| 33 bool private_browsing); | 34 bool private_browsing); |
| 34 ~AwContents(); | 35 ~AwContents(); |
| 35 | 36 |
| 37 // Methods called from Java via JNI |
| 36 jint GetWebContents(JNIEnv* env, jobject obj); | 38 jint GetWebContents(JNIEnv* env, jobject obj); |
| 37 void Destroy(JNIEnv* env, jobject obj); | 39 void Destroy(JNIEnv* env, jobject obj); |
| 40 void DocumentHasImages(JNIEnv* env, jobject obj, jobject message); |
| 38 | 41 |
| 39 private: | 42 private: |
| 40 JavaObjectWeakGlobalRef java_ref_; | 43 JavaObjectWeakGlobalRef java_ref_; |
| 41 scoped_ptr<AwContentsContainer> contents_container_; | 44 scoped_ptr<AwContentsContainer> contents_container_; |
| 42 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 45 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 46 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 43 | 47 |
| 44 DISALLOW_COPY_AND_ASSIGN(AwContents); | 48 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 bool RegisterAwContents(JNIEnv* env); | 51 bool RegisterAwContents(JNIEnv* env); |
| 48 | 52 |
| 49 } // namespace android_webview | 53 } // namespace android_webview |
| 50 | 54 |
| 51 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 55 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |