| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "ui/gfx/point.h" | 9 #include "ui/gfx/point.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 | 11 |
| 12 struct AwDrawGLInfo; | 12 struct AwDrawGLInfo; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class ContentViewCore; | 15 class ContentViewCore; |
| 16 class WebContents; | |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace gfx { | 18 namespace gfx { |
| 20 class Rect; | 19 class Rect; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace android_webview { | 22 namespace android_webview { |
| 24 | 23 |
| 25 // Interface for all the WebView-specific content rendering operations. | 24 // Interface for all the WebView-specific content rendering operations. |
| 26 // Provides software and hardware rendering and the Capture Picture API. | 25 // Provides software and hardware rendering and the Capture Picture API. |
| 27 class BrowserViewRenderer { | 26 class BrowserViewRenderer { |
| 28 public: | 27 public: |
| 29 class Client { | 28 class Client { |
| 30 public: | 29 public: |
| 31 // Called to trigger view invalidations. | 30 // Called to trigger view invalidations. |
| 32 virtual void Invalidate() = 0; | 31 virtual void Invalidate() = 0; |
| 33 | 32 |
| 34 // Called when a new Picture is available. Needs to be enabled | 33 // Called when a new Picture is available. Needs to be enabled |
| 35 // via the EnableOnNewPicture method. | 34 // via the EnableOnNewPicture method. |
| 36 virtual void OnNewPicture() = 0; | 35 virtual void OnNewPicture() = 0; |
| 37 | 36 |
| 38 // Called to get view's absolute location on the screen. | 37 // Called to get view's absolute location on the screen. |
| 39 virtual gfx::Point GetLocationOnScreen() = 0; | 38 virtual gfx::Point GetLocationOnScreen() = 0; |
| 40 | 39 |
| 41 // Called when the RenderView page scale changes. | |
| 42 virtual void OnPageScaleFactorChanged(float page_scale_factor) = 0; | |
| 43 | |
| 44 protected: | 40 protected: |
| 45 virtual ~Client() {} | 41 virtual ~Client() {} |
| 46 }; | 42 }; |
| 47 | 43 |
| 48 // Delegate to perform rendering actions involving Java objects. | 44 // Delegate to perform rendering actions involving Java objects. |
| 49 class JavaHelper { | 45 class JavaHelper { |
| 50 public: | 46 public: |
| 51 // Creates a RGBA_8888 Java Bitmap object of the requested size. | 47 // Creates a RGBA_8888 Java Bitmap object of the requested size. |
| 52 virtual base::android::ScopedJavaLocalRef<jobject> CreateBitmap( | 48 virtual base::android::ScopedJavaLocalRef<jobject> CreateBitmap( |
| 53 JNIEnv* env, | 49 JNIEnv* env, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 virtual bool IsAttachedToWindow() = 0; | 89 virtual bool IsAttachedToWindow() = 0; |
| 94 virtual bool IsViewVisible() = 0; | 90 virtual bool IsViewVisible() = 0; |
| 95 virtual gfx::Rect GetScreenRect() = 0; | 91 virtual gfx::Rect GetScreenRect() = 0; |
| 96 | 92 |
| 97 virtual ~BrowserViewRenderer() {} | 93 virtual ~BrowserViewRenderer() {} |
| 98 }; | 94 }; |
| 99 | 95 |
| 100 } // namespace android_webview | 96 } // namespace android_webview |
| 101 | 97 |
| 102 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 98 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
| OLD | NEW |