| 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 gfx { |
| 14 class Size; |
| 15 } |
| 16 |
| 13 namespace ui { | 17 namespace ui { |
| 14 class WindowAndroid; | 18 class WindowAndroid; |
| 15 } | 19 } |
| 16 | 20 |
| 17 namespace content { | 21 namespace content { |
| 18 class WebContents; | 22 class WebContents; |
| 19 | 23 |
| 20 // Native side of the ContentViewCore.java, which is the primary way of | 24 // Native side of the ContentViewCore.java, which is the primary way of |
| 21 // communicating with the native Chromium code on Android. This is a | 25 // communicating with the native Chromium code on Android. This is a |
| 22 // public interface used by native code outside of the content module. | 26 // public interface used by native code outside of the content module. |
| 23 class ContentViewCore { | 27 class ContentViewCore { |
| 24 public: | 28 public: |
| 25 // Returns the existing ContentViewCore for |web_contents|, or NULL. | 29 // Returns the existing ContentViewCore for |web_contents|, or NULL. |
| 26 static ContentViewCore* FromWebContents(WebContents* web_contents); | 30 static ContentViewCore* FromWebContents(WebContents* web_contents); |
| 27 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 31 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
| 28 | 32 |
| 29 virtual WebContents* GetWebContents() const = 0; | 33 virtual WebContents* GetWebContents() const = 0; |
| 30 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 34 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
| 31 virtual ui::WindowAndroid* GetWindowAndroid() = 0; | 35 virtual ui::WindowAndroid* GetWindowAndroid() = 0; |
| 32 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; | 36 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; |
| 33 virtual void OnWebPreferencesUpdated() = 0; | 37 virtual void OnWebPreferencesUpdated() = 0; |
| 34 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; | 38 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; |
| 35 virtual void ShowPastePopup(int x, int y) = 0; | 39 virtual void ShowPastePopup(int x, int y) = 0; |
| 40 virtual unsigned int GetScaledContentTexture(const gfx::Size& size) = 0; |
| 36 | 41 |
| 37 protected: | 42 protected: |
| 38 virtual ~ContentViewCore() {}; | 43 virtual ~ContentViewCore() {}; |
| 39 }; | 44 }; |
| 40 | 45 |
| 41 }; // namespace content | 46 }; // namespace content |
| 42 | 47 |
| 43 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 48 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
| OLD | NEW |