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 class SkBitmap; | |
16 | |
15 namespace cc { | 17 namespace cc { |
16 class Layer; | 18 class Layer; |
17 } | 19 } |
18 | 20 |
19 namespace gfx { | 21 namespace gfx { |
20 class Rect; | 22 class Rect; |
21 class Size; | 23 class Size; |
22 class SizeF; | 24 class SizeF; |
23 class Vector2dF; | 25 class Vector2dF; |
24 } | 26 } |
(...skipping 16 matching lines...) Expand all Loading... | |
41 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 43 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
42 | 44 |
43 virtual WebContents* GetWebContents() const = 0; | 45 virtual WebContents* GetWebContents() const = 0; |
44 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
45 virtual ui::ViewAndroid* GetViewAndroid() const = 0; | 47 virtual ui::ViewAndroid* GetViewAndroid() const = 0; |
46 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; | 48 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; |
47 virtual scoped_refptr<cc::Layer> GetLayer() const = 0; | 49 virtual scoped_refptr<cc::Layer> GetLayer() const = 0; |
48 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; | 50 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; |
49 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; | 51 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; |
50 virtual void ShowPastePopup(int x, int y) = 0; | 52 virtual void ShowPastePopup(int x, int y) = 0; |
51 virtual unsigned int GetScaledContentTexture( | 53 |
54 // Called with the result of a content readback. The boolean parameter | |
55 // indicates whether the content reaback was successful or not. If the | |
56 // readback was successful, an SkBitmap of the content is passed as the second | |
57 // parameter. | |
58 typedef base::Callback<void(bool, const SkBitmap&)> ContentBitmapCallback; | |
aelias_OOO_until_Jul13
2014/02/01 02:09:20
Hmm, sorry for changing my mind, but it looks like
powei
2014/02/03 10:06:52
Done.
| |
59 | |
60 // Request a scaled content readback. The result is passed through the | |
61 // callback. |out_size| is returned with the size of the content. | |
62 virtual void GetScaledContentBitmap( | |
52 float scale, | 63 float scale, |
53 gfx::Size* out_size) = 0; | 64 gfx::Size* out_size, |
65 const ContentBitmapCallback& result_callback) = 0; | |
54 virtual float GetDpiScale() const = 0; | 66 virtual float GetDpiScale() const = 0; |
55 virtual void RequestContentClipping(const gfx::Rect& clipping, | 67 virtual void RequestContentClipping(const gfx::Rect& clipping, |
56 const gfx::Size& content_size) = 0; | 68 const gfx::Size& content_size) = 0; |
57 virtual void PauseVideo() = 0; | 69 virtual void PauseVideo() = 0; |
58 virtual void ResumeVideo() = 0; | 70 virtual void ResumeVideo() = 0; |
59 virtual void PauseOrResumeGeolocation(bool should_pause) = 0; | 71 virtual void PauseOrResumeGeolocation(bool should_pause) = 0; |
60 | 72 |
61 // Observer callback for frame metadata updates. | 73 // Observer callback for frame metadata updates. |
62 typedef base::Callback<void( | 74 typedef base::Callback<void( |
63 const gfx::SizeF& content_size, | 75 const gfx::SizeF& content_size, |
64 const gfx::Vector2dF& scroll_offset, | 76 const gfx::Vector2dF& scroll_offset, |
65 float page_scale_factor)> UpdateFrameInfoCallback; | 77 float page_scale_factor)> UpdateFrameInfoCallback; |
66 | 78 |
67 protected: | 79 protected: |
68 virtual ~ContentViewCore() {}; | 80 virtual ~ContentViewCore() {}; |
69 }; | 81 }; |
70 | 82 |
71 }; // namespace content | 83 }; // namespace content |
72 | 84 |
73 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 85 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
OLD | NEW |