| 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 class ContentViewCore { | 23 class ContentViewCore { |
| 24 public: | 24 public: |
| 25 static ContentViewCore* Create( | 25 // Returns the existing ContentViewCore for |web_contents|, or NULL. |
| 26 JNIEnv* env, jobject obj, WebContents* web_contents); | 26 static ContentViewCore* FromWebContents(WebContents* web_contents); |
| 27 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 27 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
| 28 | 28 |
| 29 virtual void Destroy(JNIEnv* env, jobject obj) = 0; | |
| 30 virtual WebContents* GetWebContents() const = 0; | 29 virtual WebContents* GetWebContents() const = 0; |
| 31 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 30 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
| 32 virtual ui::WindowAndroid* GetWindowAndroid() = 0; | 31 virtual ui::WindowAndroid* GetWindowAndroid() = 0; |
| 33 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; | 32 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; |
| 34 virtual void OnWebPreferencesUpdated() = 0; | 33 virtual void OnWebPreferencesUpdated() = 0; |
| 35 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; | 34 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; |
| 36 | 35 |
| 37 protected: | 36 protected: |
| 38 virtual ~ContentViewCore() {}; | 37 virtual ~ContentViewCore() {}; |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 }; // namespace content | 40 }; // namespace content |
| 42 | 41 |
| 43 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 42 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
| OLD | NEW |