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