Chromium Code Reviews

Side by Side Diff: content/public/browser/render_widget_host.h

Issue 23416003: Add content::RenderWidgetHost::MouseEventCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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_RENDER_WIDGET_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "content/public/browser/keyboard_listener.h" 10 #include "content/public/browser/keyboard_listener.h"
(...skipping 16 matching lines...)
27 namespace gfx { 27 namespace gfx {
28 class Rect; 28 class Rect;
29 } 29 }
30 30
31 namespace WebKit { 31 namespace WebKit {
32 struct WebScreenInfo; 32 struct WebScreenInfo;
33 } 33 }
34 34
35 namespace content { 35 namespace content {
36 36
37 class MouseListener;
37 class RenderProcessHost; 38 class RenderProcessHost;
38 class RenderWidgetHostImpl; 39 class RenderWidgetHostImpl;
39 class RenderWidgetHostView; 40 class RenderWidgetHostView;
40 41
41 // A RenderWidgetHost manages the browser side of a browser<->renderer 42 // A RenderWidgetHost manages the browser side of a browser<->renderer
42 // HWND connection. The HWND lives in the browser process, and 43 // HWND connection. The HWND lives in the browser process, and
43 // windows events are sent over IPC to the corresponding object in the 44 // windows events are sent over IPC to the corresponding object in the
44 // renderer. The renderer paints into shared memory, which we 45 // renderer. The renderer paints into shared memory, which we
45 // transfer to a backing store and blit to the screen when Windows 46 // transfer to a backing store and blit to the screen when Windows
46 // sends us a WM_PAINT message. 47 // sends us a WM_PAINT message.
(...skipping 242 matching lines...)
289 // Access to the implementation's IPC::Listener::OnMessageReceived. Intended 290 // Access to the implementation's IPC::Listener::OnMessageReceived. Intended
290 // only for test code. 291 // only for test code.
291 292
292 // Add a keyboard listener that can handle key presses without requiring 293 // Add a keyboard listener that can handle key presses without requiring
293 // focus. 294 // focus.
294 virtual void AddKeyboardListener(KeyboardListener* listener) = 0; 295 virtual void AddKeyboardListener(KeyboardListener* listener) = 0;
295 296
296 // Remove a keyboard listener. 297 // Remove a keyboard listener.
297 virtual void RemoveKeyboardListener(KeyboardListener* listener) = 0; 298 virtual void RemoveKeyboardListener(KeyboardListener* listener) = 0;
298 299
300 // Add a mouse listener that can handle all kinds of mouse events.
301 virtual void AddMouseListener(MouseListener* listener) = 0;
302
303 // Remove a mouse listener.
304 virtual void RemoveMouseListener(MouseListener* listener) = 0;
305
299 // Get the screen info corresponding to this render widget. 306 // Get the screen info corresponding to this render widget.
300 virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) = 0; 307 virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) = 0;
301 308
302 // Grabs snapshot from renderer side and returns the bitmap to a callback. 309 // Grabs snapshot from renderer side and returns the bitmap to a callback.
303 // If |src_rect| is empty, the whole contents is copied. This is an expensive 310 // If |src_rect| is empty, the whole contents is copied. This is an expensive
304 // operation due to the IPC, but it can be used as a fallback method when 311 // operation due to the IPC, but it can be used as a fallback method when
305 // CopyFromBackingStore fails due to the backing store not being available or, 312 // CopyFromBackingStore fails due to the backing store not being available or,
306 // in composited mode, when the accelerated surface is not available to the 313 // in composited mode, when the accelerated surface is not available to the
307 // browser side. 314 // browser side.
308 virtual void GetSnapshotFromRenderer( 315 virtual void GetSnapshotFromRenderer(
309 const gfx::Rect& src_subrect, 316 const gfx::Rect& src_subrect,
310 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; 317 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0;
311 318
312 protected: 319 protected:
313 friend class RenderWidgetHostImpl; 320 friend class RenderWidgetHostImpl;
314 321
315 // Retrieves the implementation class. Intended only for code 322 // Retrieves the implementation class. Intended only for code
316 // within content/. This method is necessary because 323 // within content/. This method is necessary because
317 // RenderWidgetHost is the root of a diamond inheritance pattern, so 324 // RenderWidgetHost is the root of a diamond inheritance pattern, so
318 // subclasses inherit it virtually, which removes our ability to 325 // subclasses inherit it virtually, which removes our ability to
319 // static_cast to the subclass. 326 // static_cast to the subclass.
320 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; 327 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0;
321 }; 328 };
322 329
323 } // namespace content 330 } // namespace content
324 331
325 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ 332 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_
OLDNEW
« content/public/browser/mouse_listener.h ('K') | « content/public/browser/mouse_listener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine