Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: android_webview/browser/in_process_view_renderer.h

Issue 16255010: Hookup android_webview scroll offset delegation to Java side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_
6 #define ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_
7 7
8 #include "android_webview/browser/browser_view_renderer.h" 8 #include "android_webview/browser/browser_view_renderer.h"
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "content/public/browser/android/synchronous_compositor_client.h" 11 #include "content/public/browser/android/synchronous_compositor_client.h"
12 #include "ui/gfx/vector2d_f.h"
12 13
13 namespace content { 14 namespace content {
14 class SynchronousCompositor; 15 class SynchronousCompositor;
15 class WebContents; 16 class WebContents;
16 } 17 }
17 18
18 typedef void* EGLContext; 19 typedef void* EGLContext;
19 class SkCanvas; 20 class SkCanvas;
20 21
21 namespace android_webview { 22 namespace android_webview {
22 23
23 // Provides RenderViewHost wrapper functionality for sending WebView-specific 24 // Provides RenderViewHost wrapper functionality for sending WebView-specific
24 // IPC messages to the renderer and from there to WebKit. 25 // IPC messages to the renderer and from there to WebKit.
25 class InProcessViewRenderer : public BrowserViewRenderer, 26 class InProcessViewRenderer : public BrowserViewRenderer,
26 public content::SynchronousCompositorClient { 27 public content::SynchronousCompositorClient {
27 public: 28 public:
28 InProcessViewRenderer(BrowserViewRenderer::Client* client, 29 InProcessViewRenderer(BrowserViewRenderer::Client* client,
29 JavaHelper* java_helper); 30 JavaHelper* java_helper);
30 virtual ~InProcessViewRenderer(); 31 virtual ~InProcessViewRenderer();
31 32
32 static InProcessViewRenderer* FromWebContents( 33 static InProcessViewRenderer* FromWebContents(
33 content::WebContents* contents); 34 content::WebContents* contents);
34 35
35 // BrowserViewRenderer overrides 36 // BrowserViewRenderer overrides
36 virtual void SetContents( 37 virtual void SetContents(
37 content::ContentViewCore* content_view_core) OVERRIDE; 38 content::ContentViewCore* content_view_core) OVERRIDE;
38 virtual bool OnDraw(jobject java_canvas, 39 virtual bool OnDraw(jobject java_canvas,
39 bool is_hardware_canvas, 40 bool is_hardware_canvas,
40 const gfx::Point& scroll, 41 const gfx::Vector2d& scroll_pix,
41 const gfx::Rect& clip) OVERRIDE; 42 const gfx::Rect& clip) OVERRIDE;
42 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE; 43 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE;
43 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE; 44 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE;
44 virtual void EnableOnNewPicture(bool enabled) OVERRIDE; 45 virtual void EnableOnNewPicture(bool enabled) OVERRIDE;
45 virtual void OnVisibilityChanged( 46 virtual void OnVisibilityChanged(
46 bool view_visible, bool window_visible) OVERRIDE; 47 bool view_visible, bool window_visible) OVERRIDE;
47 virtual void OnSizeChanged(int width, int height) OVERRIDE; 48 virtual void OnSizeChanged(int width, int height) OVERRIDE;
49 virtual void ScrollTo(gfx::Vector2dF new_value_css) OVERRIDE;
joth 2013/06/18 03:19:50 ah ha! over here you call it CSS pixels :)
mkosiba (inactive) 2013/06/18 18:09:25 see? making it explicit is paying off already :)
48 virtual void OnAttachedToWindow(int width, int height) OVERRIDE; 50 virtual void OnAttachedToWindow(int width, int height) OVERRIDE;
49 virtual void OnDetachedFromWindow() OVERRIDE; 51 virtual void OnDetachedFromWindow() OVERRIDE;
50 virtual bool IsAttachedToWindow() OVERRIDE; 52 virtual bool IsAttachedToWindow() OVERRIDE;
51 virtual bool IsViewVisible() OVERRIDE; 53 virtual bool IsViewVisible() OVERRIDE;
52 virtual gfx::Rect GetScreenRect() OVERRIDE; 54 virtual gfx::Rect GetScreenRect() OVERRIDE;
53 55
54 // SynchronousCompositorClient overrides 56 // SynchronousCompositorClient overrides
55 virtual void DidInitializeCompositor( 57 virtual void DidInitializeCompositor(
56 content::SynchronousCompositor* compositor) OVERRIDE; 58 content::SynchronousCompositor* compositor) OVERRIDE;
57 virtual void DidDestroyCompositor( 59 virtual void DidDestroyCompositor(
(...skipping 30 matching lines...) Expand all
88 90
89 bool attached_to_window_; 91 bool attached_to_window_;
90 bool hardware_initialized_; 92 bool hardware_initialized_;
91 bool hardware_failed_; 93 bool hardware_failed_;
92 94
93 // Used only for detecting Android View System context changes. 95 // Used only for detecting Android View System context changes.
94 // Not to be used between draw calls. 96 // Not to be used between draw calls.
95 EGLContext egl_context_at_init_; 97 EGLContext egl_context_at_init_;
96 98
97 // Last View scroll when View.onDraw() was called. 99 // Last View scroll when View.onDraw() was called.
98 gfx::Point scroll_at_start_of_frame_; 100 gfx::Vector2d scroll_at_start_of_frame_pix_;
99 101
100 gfx::Vector2dF scroll_offset_; 102 // Current scroll offset in CSS pixels.
103 gfx::Vector2dF scroll_offset_css_;
101 104
102 base::WeakPtrFactory<InProcessViewRenderer> weak_factory_; 105 base::WeakPtrFactory<InProcessViewRenderer> weak_factory_;
103 106
104 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); 107 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer);
105 }; 108 };
106 109
107 } // namespace android_webview 110 } // namespace android_webview
108 111
109 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ 112 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698