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

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

Issue 15920002: Fix WebView compositor input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 7 years, 7 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
OLDNEW
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_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_impl.h" 8 #include "android_webview/browser/browser_view_renderer_impl.h"
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "content/public/renderer/android/synchronous_compositor_client.h" 11 #include "content/public/renderer/android/synchronous_compositor_client.h"
12 12
13 namespace content { 13 namespace content {
14 class SynchronousCompositor; 14 class SynchronousCompositor;
15 class SynchronousInputEventFilter;
15 class WebContents; 16 class WebContents;
16 } 17 }
17 18
19 namespace WebKit {
20 class WebInputEvent;
21 }
22
18 namespace android_webview { 23 namespace android_webview {
19 24
20 // Provides RenderViewHost wrapper functionality for sending WebView-specific 25 // Provides RenderViewHost wrapper functionality for sending WebView-specific
21 // IPC messages to the renderer and from there to WebKit. 26 // IPC messages to the renderer and from there to WebKit.
22 class InProcessViewRenderer : public BrowserViewRenderer, 27 class InProcessViewRenderer : public BrowserViewRenderer,
23 public content::SynchronousCompositorClient { 28 public content::SynchronousCompositorClient {
24 public: 29 public:
25 InProcessViewRenderer(BrowserViewRenderer::Client* client, 30 InProcessViewRenderer(BrowserViewRenderer::Client* client,
26 JavaHelper* java_helper); 31 JavaHelper* java_helper);
27 virtual ~InProcessViewRenderer(); 32 virtual ~InProcessViewRenderer();
28 33
29 static InProcessViewRenderer* FromWebContents( 34 static InProcessViewRenderer* FromWebContents(
30 content::WebContents* contents); 35 content::WebContents* contents);
31 static InProcessViewRenderer* FromId( 36 static InProcessViewRenderer* FromId(
32 int render_process_id, int render_view_id); 37 int render_process_id, int render_view_id);
33 void BindSynchronousCompositor( 38 void BindSynchronousCompositor(
34 content::SynchronousCompositor* compositor); 39 content::SynchronousCompositor* compositor);
40 void BindSynchronousInputEventFilter(
41 content::SynchronousInputEventFilter* input_event_filter);
35 42
36 // BrowserViewRenderer overrides 43 // BrowserViewRenderer overrides
37 virtual void SetContents( 44 virtual void SetContents(
38 content::ContentViewCore* content_view_core) OVERRIDE; 45 content::ContentViewCore* content_view_core) OVERRIDE;
39 virtual bool PrepareDrawGL(int x, int y) OVERRIDE; 46 virtual bool PrepareDrawGL(int x, int y) OVERRIDE;
40 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE; 47 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE;
41 virtual bool DrawSW(jobject java_canvas, 48 virtual bool DrawSW(jobject java_canvas,
42 const gfx::Rect& clip_bounds) OVERRIDE; 49 const gfx::Rect& clip_bounds) OVERRIDE;
43 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE; 50 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE;
44 virtual void EnableOnNewPicture(bool enabled) OVERRIDE; 51 virtual void EnableOnNewPicture(bool enabled) OVERRIDE;
(...skipping 16 matching lines...) Expand all
61 private: 68 private:
62 void Invalidate(); 69 void Invalidate();
63 void EnsureContinuousInvalidation(); 70 void EnsureContinuousInvalidation();
64 bool DrawSWInternal(jobject java_canvas, 71 bool DrawSWInternal(jobject java_canvas,
65 const gfx::Rect& clip_bounds); 72 const gfx::Rect& clip_bounds);
66 bool RenderSW(SkCanvas* canvas); 73 bool RenderSW(SkCanvas* canvas);
67 bool CompositeSW(SkCanvas* canvas); 74 bool CompositeSW(SkCanvas* canvas);
68 75
69 BrowserViewRenderer::Client* client_; 76 BrowserViewRenderer::Client* client_;
70 BrowserViewRenderer::JavaHelper* java_helper_; 77 BrowserViewRenderer::JavaHelper* java_helper_;
78 content::ContentViewCore* content_view_core_;
71 content::WebContents* web_contents_; 79 content::WebContents* web_contents_;
72 content::SynchronousCompositor* compositor_; 80 content::SynchronousCompositor* compositor_;
81 content::SynchronousInputEventFilter* input_event_filter_;
73 82
74 bool view_visible_; 83 bool view_visible_;
75 84
76 // When true, we should continuously invalidate and keep drawing, for example 85 // When true, we should continuously invalidate and keep drawing, for example
77 // to drive animation. 86 // to drive animation.
78 bool continuous_invalidate_; 87 bool continuous_invalidate_;
79 // True while an asynchronous invalidation task is pending. 88 // True while an asynchronous invalidation task is pending.
80 bool continuous_invalidate_task_pending_; 89 bool continuous_invalidate_task_pending_;
81 90
82 int width_; 91 int width_;
(...skipping 11 matching lines...) Expand all
94 gfx::Point hw_rendering_scroll_; 103 gfx::Point hw_rendering_scroll_;
95 104
96 base::WeakPtrFactory<InProcessViewRenderer> weak_factory_; 105 base::WeakPtrFactory<InProcessViewRenderer> weak_factory_;
97 106
98 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); 107 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer);
99 }; 108 };
100 109
101 } // namespace android_webview 110 } // namespace android_webview
102 111
103 #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