| 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 // Returns the AwContents instance associated with |web_contents|, or NULL. | 31 // Returns the AwContents instance associated with |web_contents|, or NULL. |
| 31 static AwContents* FromWebContents(content::WebContents* web_contents); | 32 static AwContents* FromWebContents(content::WebContents* web_contents); |
| 32 | 33 |
| 33 AwContents(JNIEnv* env, | 34 AwContents(JNIEnv* env, |
| 34 jobject obj, | 35 jobject obj, |
| 35 jobject web_contents_delegate, | 36 jobject web_contents_delegate, |
| 36 bool private_browsing); | 37 bool private_browsing); |
| 37 ~AwContents(); | 38 ~AwContents(); |
| 38 | 39 |
| 39 // Methods called from Java. | 40 // Methods called from Java. |
| 40 jint GetWebContents(JNIEnv* env, jobject obj); | 41 jint GetWebContents(JNIEnv* env, jobject obj); |
| 41 void Destroy(JNIEnv* env, jobject obj); | 42 void Destroy(JNIEnv* env, jobject obj); |
| 43 void DocumentHasImages(JNIEnv* env, jobject obj, jobject message); |
| 42 | 44 |
| 43 private: | 45 private: |
| 44 JavaObjectWeakGlobalRef java_ref_; | 46 JavaObjectWeakGlobalRef java_ref_; |
| 45 scoped_ptr<AwContentsContainer> contents_container_; | 47 scoped_ptr<AwContentsContainer> contents_container_; |
| 46 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 48 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 49 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 47 | 50 |
| 48 DISALLOW_COPY_AND_ASSIGN(AwContents); | 51 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 bool RegisterAwContents(JNIEnv* env); | 54 bool RegisterAwContents(JNIEnv* env); |
| 52 | 55 |
| 53 } // namespace android_webview | 56 } // namespace android_webview |
| 54 | 57 |
| 55 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 58 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |