| 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 <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 class Layer; | 16 class Layer; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class Size; | 20 class Size; |
| 21 class SizeF; | 21 class SizeF; |
| 22 class Vector2dF; | 22 class Vector2dF; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace ui { | 25 namespace ui { |
| 26 class ViewAndroid; |
| 26 class WindowAndroid; | 27 class WindowAndroid; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace WebKit { | 30 namespace WebKit { |
| 30 class WebCompositorInputHandler; | 31 class WebCompositorInputHandler; |
| 31 } | 32 } |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| 34 class WebContents; | 35 class WebContents; |
| 35 | 36 |
| 36 // Native side of the ContentViewCore.java, which is the primary way of | 37 // Native side of the ContentViewCore.java, which is the primary way of |
| 37 // communicating with the native Chromium code on Android. This is a | 38 // communicating with the native Chromium code on Android. This is a |
| 38 // public interface used by native code outside of the content module. | 39 // public interface used by native code outside of the content module. |
| 39 class CONTENT_EXPORT ContentViewCore { | 40 class CONTENT_EXPORT ContentViewCore { |
| 40 public: | 41 public: |
| 41 // Returns the existing ContentViewCore for |web_contents|, or NULL. | 42 // Returns the existing ContentViewCore for |web_contents|, or NULL. |
| 42 static ContentViewCore* FromWebContents(WebContents* web_contents); | 43 static ContentViewCore* FromWebContents(WebContents* web_contents); |
| 43 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 44 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
| 44 | 45 |
| 45 virtual WebContents* GetWebContents() const = 0; | 46 virtual WebContents* GetWebContents() const = 0; |
| 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 47 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
| 47 virtual base::android::ScopedJavaLocalRef<jobject> GetContainerViewDelegate() | 48 virtual ui::ViewAndroid* GetViewAndroid() const = 0; |
| 48 = 0; | |
| 49 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; | 49 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; |
| 50 virtual scoped_refptr<cc::Layer> GetLayer() const = 0; | 50 virtual scoped_refptr<cc::Layer> GetLayer() const = 0; |
| 51 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; | 51 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; |
| 52 virtual void OnWebPreferencesUpdated() = 0; | 52 virtual void OnWebPreferencesUpdated() = 0; |
| 53 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; | 53 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; |
| 54 virtual void ShowPastePopup(int x, int y) = 0; | 54 virtual void ShowPastePopup(int x, int y) = 0; |
| 55 virtual unsigned int GetScaledContentTexture( | 55 virtual unsigned int GetScaledContentTexture( |
| 56 float scale, | 56 float scale, |
| 57 gfx::Size* out_size) = 0; | 57 gfx::Size* out_size) = 0; |
| 58 virtual float GetDpiScale() const = 0; | 58 virtual float GetDpiScale() const = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 70 virtual void RemoveFrameInfoCallback( | 70 virtual void RemoveFrameInfoCallback( |
| 71 const UpdateFrameInfoCallback& callback) = 0; | 71 const UpdateFrameInfoCallback& callback) = 0; |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 virtual ~ContentViewCore() {}; | 74 virtual ~ContentViewCore() {}; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 }; // namespace content | 77 }; // namespace content |
| 78 | 78 |
| 79 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 79 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
| OLD | NEW |