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 30 matching lines...) Expand all Loading... |
41 static ContentViewCore* FromWebContents(WebContents* web_contents); | 41 static ContentViewCore* FromWebContents(WebContents* web_contents); |
42 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 42 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
43 | 43 |
44 virtual WebContents* GetWebContents() const = 0; | 44 virtual WebContents* GetWebContents() const = 0; |
45 | 45 |
46 // May return null reference. | 46 // May return null reference. |
47 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 47 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
48 virtual ui::ViewAndroid* GetViewAndroid() const = 0; | 48 virtual ui::ViewAndroid* GetViewAndroid() const = 0; |
49 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; | 49 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; |
50 virtual const scoped_refptr<cc::Layer>& GetLayer() const = 0; | 50 virtual const scoped_refptr<cc::Layer>& GetLayer() const = 0; |
51 virtual void ShowPastePopup(int x, int y) = 0; | 51 virtual bool ShowPastePopup(int x, int y) = 0; |
52 | 52 |
53 // Request a scaled content readback. The result is passed through the | 53 // Request a scaled content readback. The result is passed through the |
54 // callback. The boolean parameter indicates whether the readback was a | 54 // callback. The boolean parameter indicates whether the readback was a |
55 // success or not. The content is passed through the SkBitmap parameter. | 55 // success or not. The content is passed through the SkBitmap parameter. |
56 virtual void GetScaledContentBitmap( | 56 virtual void GetScaledContentBitmap( |
57 float scale, | 57 float scale, |
58 SkColorType color_type, | 58 SkColorType color_type, |
59 const gfx::Rect& src_rect, | 59 const gfx::Rect& src_rect, |
60 const ReadbackRequestCallback& result_callback) = 0; | 60 const ReadbackRequestCallback& result_callback) = 0; |
61 virtual float GetDpiScale() const = 0; | 61 virtual float GetDpiScale() const = 0; |
62 virtual void PauseOrResumeGeolocation(bool should_pause) = 0; | 62 virtual void PauseOrResumeGeolocation(bool should_pause) = 0; |
63 | 63 |
64 // Text surrounding selection. | 64 // Text surrounding selection. |
65 virtual void RequestTextSurroundingSelection( | 65 virtual void RequestTextSurroundingSelection( |
66 int max_length, | 66 int max_length, |
67 const base::Callback<void(const base::string16& content, | 67 const base::Callback<void(const base::string16& content, |
68 int start_offset, | 68 int start_offset, |
69 int end_offset)>& callback) = 0; | 69 int end_offset)>& callback) = 0; |
70 | 70 |
71 protected: | 71 protected: |
72 virtual ~ContentViewCore() {} | 72 virtual ~ContentViewCore() {} |
73 }; | 73 }; |
74 | 74 |
75 }; // namespace content | 75 }; // namespace content |
76 | 76 |
77 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 77 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
OLD | NEW |