| 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" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Native side of the ContentViewCore.java, which is the primary way of | 38 // Native side of the ContentViewCore.java, which is the primary way of |
| 39 // communicating with the native Chromium code on Android. This is a | 39 // communicating with the native Chromium code on Android. This is a |
| 40 // public interface used by native code outside of the content module. | 40 // public interface used by native code outside of the content module. |
| 41 class CONTENT_EXPORT ContentViewCore { | 41 class CONTENT_EXPORT ContentViewCore { |
| 42 public: | 42 public: |
| 43 // Returns the existing ContentViewCore for |web_contents|, or nullptr. | 43 // Returns the existing ContentViewCore for |web_contents|, or nullptr. |
| 44 static ContentViewCore* FromWebContents(WebContents* web_contents); | 44 static ContentViewCore* FromWebContents(WebContents* web_contents); |
| 45 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 45 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
| 46 | 46 |
| 47 virtual WebContents* GetWebContents() const = 0; | 47 virtual WebContents* GetWebContents() const = 0; |
| 48 |
| 49 // May return null reference. |
| 48 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 50 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
| 49 virtual ui::ViewAndroid* GetViewAndroid() const = 0; | 51 virtual ui::ViewAndroid* GetViewAndroid() const = 0; |
| 50 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; | 52 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; |
| 51 virtual const scoped_refptr<cc::Layer>& GetLayer() const = 0; | 53 virtual const scoped_refptr<cc::Layer>& GetLayer() const = 0; |
| 52 virtual void ShowPastePopup(int x, int y) = 0; | 54 virtual void ShowPastePopup(int x, int y) = 0; |
| 53 | 55 |
| 54 // Request a scaled content readback. The result is passed through the | 56 // Request a scaled content readback. The result is passed through the |
| 55 // callback. The boolean parameter indicates whether the readback was a | 57 // callback. The boolean parameter indicates whether the readback was a |
| 56 // success or not. The content is passed through the SkBitmap parameter. | 58 // success or not. The content is passed through the SkBitmap parameter. |
| 57 virtual void GetScaledContentBitmap( | 59 virtual void GetScaledContentBitmap( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 75 int start_offset, | 77 int start_offset, |
| 76 int end_offset)>& callback) = 0; | 78 int end_offset)>& callback) = 0; |
| 77 | 79 |
| 78 protected: | 80 protected: |
| 79 virtual ~ContentViewCore() {}; | 81 virtual ~ContentViewCore() {}; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 }; // namespace content | 84 }; // namespace content |
| 83 | 85 |
| 84 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 86 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
| OLD | NEW |