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 CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include <jni.h> | 9 #include <jni.h> |
10 | 10 |
11 #include "content/public/browser/navigation_controller.h" | 11 #include "content/public/browser/navigation_controller.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 class WindowAndroid; | 14 class WindowAndroid; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 | 19 |
20 // Native side of the ContentViewCore.java, which is the primary way of | 20 // Native side of the ContentViewCore.java, which is the primary way of |
21 // communicating with the native Chromium code on Android. This is a | 21 // communicating with the native Chromium code on Android. This is a |
22 // public interface used by native code outside of the content module. | 22 // public interface used by native code outside of the content module. |
23 // | |
24 // TODO(jrg): downstream, this class derives from | |
25 // base::SupportsWeakPtr<ContentViewCore>. Issues raised in | |
26 // http://codereview.chromium.org/10536066/ make us want to rethink | |
27 // ownership issues. | |
28 // FOR THE MERGE (downstream), re-add derivation from | |
29 // base::SupportsWeakPtr<ContentViewCore> to keep everything else working | |
30 // until this issue is resolved. | |
31 // http://b/6666045 | |
32 class ContentViewCore { | 23 class ContentViewCore { |
33 public: | 24 public: |
34 virtual void Destroy(JNIEnv* env, jobject obj) = 0; | 25 virtual void Destroy(JNIEnv* env, jobject obj) = 0; |
35 virtual WebContents* GetWebContents() const = 0; | 26 virtual WebContents* GetWebContents() const = 0; |
36 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 27 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
37 virtual ui::WindowAndroid* GetWindowAndroid() = 0; | 28 virtual ui::WindowAndroid* GetWindowAndroid() = 0; |
38 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; | 29 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; |
39 | 30 |
40 static ContentViewCore* Create( | 31 static ContentViewCore* Create( |
41 JNIEnv* env, jobject obj, WebContents* web_contents); | 32 JNIEnv* env, jobject obj, WebContents* web_contents); |
42 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 33 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
43 protected: | 34 protected: |
44 virtual ~ContentViewCore() {}; | 35 virtual ~ContentViewCore() {}; |
45 }; | 36 }; |
46 | 37 |
47 }; // namespace content | 38 }; // namespace content |
48 | 39 |
49 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 40 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
OLD | NEW |