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 16 matching lines...) Expand all Loading... | |
27 class WindowAndroid; | 27 class WindowAndroid; |
28 } | 28 } |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 | 31 |
32 class WebContents; | 32 class WebContents; |
33 | 33 |
34 // Native side of the ContentViewCore.java, which is the primary way of | 34 // Native side of the ContentViewCore.java, which is the primary way of |
35 // communicating with the native Chromium code on Android. This is a | 35 // communicating with the native Chromium code on Android. This is a |
36 // public interface used by native code outside of the content module. | 36 // public interface used by native code outside of the content module. |
37 class CONTENT_EXPORT ContentViewCore : public ui::ViewAndroid { | 37 class CONTENT_EXPORT ContentViewCore { |
38 public: | 38 public: |
39 // Returns the existing ContentViewCore for |web_contents|, or nullptr. | 39 // Returns the existing ContentViewCore for |web_contents|, or nullptr. |
40 static ContentViewCore* FromWebContents(WebContents* web_contents); | 40 static ContentViewCore* FromWebContents(WebContents* web_contents); |
41 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 41 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
42 | 42 |
43 virtual WebContents* GetWebContents() const = 0; | 43 virtual WebContents* GetWebContents() const = 0; |
44 | 44 |
45 // May return null reference. | 45 // May return null reference. |
46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
47 virtual const scoped_refptr<cc::Layer>& GetLayer() const = 0; | |
48 virtual bool ShowPastePopup(int x, int y) = 0; | 47 virtual bool ShowPastePopup(int x, int y) = 0; |
49 | 48 |
50 virtual float GetDpiScale() const = 0; | 49 virtual float GetDpiScale() const = 0; |
51 virtual void PauseOrResumeGeolocation(bool should_pause) = 0; | 50 virtual void PauseOrResumeGeolocation(bool should_pause) = 0; |
52 | 51 |
53 // Text surrounding selection. | 52 // Text surrounding selection. |
54 virtual void RequestTextSurroundingSelection( | 53 virtual void RequestTextSurroundingSelection( |
55 int max_length, | 54 int max_length, |
56 const base::Callback<void(const base::string16& content, | 55 const base::Callback<void(const base::string16& content, |
57 int start_offset, | 56 int start_offset, |
58 int end_offset)>& callback) = 0; | 57 int end_offset)>& callback) = 0; |
59 | 58 |
59 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; | |
60 virtual const base::android::JavaRef<jobject>& GetViewAndroidDelegate() | |
61 const = 0; | |
62 virtual cc::Layer* GetLayer() const = 0; | |
Yusuf
2016/07/08 16:35:05
should getViewAndroid be here too?
no sievers
2016/07/08 18:29:04
I really want to get rid of CVC :)
I'm thinking s
| |
63 | |
60 protected: | 64 protected: |
61 ~ContentViewCore() override {} | 65 ~ContentViewCore() {} |
62 }; | 66 }; |
63 | 67 |
64 }; // namespace content | 68 }; // namespace content |
65 | 69 |
66 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 70 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
OLD | NEW |