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

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

Issue 7618036: mac: Only let two-finger-scrolling trigger history if web doesn't swallow gesture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestRenderViewHost Created 9 years, 4 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // not be sent to the renderer anymore. Otherwise, if the |event| would 397 // not be sent to the renderer anymore. Otherwise, if the |event| would
398 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, 398 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
399 // |*is_keyboard_shortcut| should be set to true. 399 // |*is_keyboard_shortcut| should be set to true.
400 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, 400 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
401 bool* is_keyboard_shortcut); 401 bool* is_keyboard_shortcut);
402 402
403 // Called when a keyboard event was not processed by the renderer. This is 403 // Called when a keyboard event was not processed by the renderer. This is
404 // overridden by RenderView to send upwards to its delegate. 404 // overridden by RenderView to send upwards to its delegate.
405 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {} 405 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {}
406 406
407 // Called when a mousewheel event was not processed by the renderer. This is
408 // overridden by RenderView to send upwards to its delegate.
409 virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) {}
410
407 // Notification that the user has made some kind of input that could 411 // Notification that the user has made some kind of input that could
408 // perform an action. The render view host overrides this to forward the 412 // perform an action. The render view host overrides this to forward the
409 // information to its delegate (see corresponding function in 413 // information to its delegate (see corresponding function in
410 // RenderViewHostDelegate). The gestures that count are 1) any mouse down 414 // RenderViewHostDelegate). The gestures that count are 1) any mouse down
411 // event and 2) enter or space key presses. 415 // event and 2) enter or space key presses.
412 virtual void OnUserGesture() {} 416 virtual void OnUserGesture() {}
413 417
414 // Callbacks for notification when the renderer becomes unresponsive to user 418 // Callbacks for notification when the renderer becomes unresponsive to user
415 // input events, and subsequently responsive again. RenderViewHost overrides 419 // input events, and subsequently responsive again. RenderViewHost overrides
416 // these to tell its delegate to show the user a warning. 420 // these to tell its delegate to show the user a warning.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // is the newly painted pixels by the renderer. 507 // is the newly painted pixels by the renderer.
504 void ScrollBackingStoreRect(int dx, int dy, const gfx::Rect& clip_rect, 508 void ScrollBackingStoreRect(int dx, int dy, const gfx::Rect& clip_rect,
505 const gfx::Size& view_size); 509 const gfx::Size& view_size);
506 510
507 // Called by OnMsgInputEventAck() to process a keyboard event ack message. 511 // Called by OnMsgInputEventAck() to process a keyboard event ack message.
508 void ProcessKeyboardEventAck(int type, bool processed); 512 void ProcessKeyboardEventAck(int type, bool processed);
509 513
510 // Called by OnMsgInputEventAck() to process a wheel event ack message. 514 // Called by OnMsgInputEventAck() to process a wheel event ack message.
511 // This could result in a task being posted to allow additional wheel 515 // This could result in a task being posted to allow additional wheel
512 // input messages to be coalesced. 516 // input messages to be coalesced.
513 void ProcessWheelAck(); 517 void ProcessWheelAck(bool processed);
514 518
515 // True if renderer accessibility is enabled. This should only be set when a 519 // True if renderer accessibility is enabled. This should only be set when a
516 // screenreader is detected as it can potentially slow down Chrome. 520 // screenreader is detected as it can potentially slow down Chrome.
517 bool renderer_accessible_; 521 bool renderer_accessible_;
518 522
519 // The View associated with the RenderViewHost. The lifetime of this object 523 // The View associated with the RenderViewHost. The lifetime of this object
520 // is associated with the lifetime of the Render process. If the Renderer 524 // is associated with the lifetime of the Render process. If the Renderer
521 // crashes, its View is destroyed and this pointer becomes NULL, even though 525 // crashes, its View is destroyed and this pointer becomes NULL, even though
522 // render_view_host_ lives on to load another URL (creating a new View while 526 // render_view_host_ lives on to load another URL (creating a new View while
523 // doing so). 527 // doing so).
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. 583 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message.
580 bool mouse_move_pending_; 584 bool mouse_move_pending_;
581 585
582 // The next mouse move event to send (only non-null while mouse_move_pending_ 586 // The next mouse move event to send (only non-null while mouse_move_pending_
583 // is true). 587 // is true).
584 scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_; 588 scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_;
585 589
586 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent 590 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent
587 // and we are waiting for a corresponding ack. 591 // and we are waiting for a corresponding ack.
588 bool mouse_wheel_pending_; 592 bool mouse_wheel_pending_;
593 WebKit::WebMouseWheelEvent current_wheel_event_;
589 594
590 typedef std::deque<WebKit::WebMouseWheelEvent> WheelEventQueue; 595 typedef std::deque<WebKit::WebMouseWheelEvent> WheelEventQueue;
591 596
592 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send. 597 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send.
593 // Unlike mouse moves, mouse wheel events received while one is pending are 598 // Unlike mouse moves, mouse wheel events received while one is pending are
594 // coalesced (by accumulating deltas) if they match the previous event in 599 // coalesced (by accumulating deltas) if they match the previous event in
595 // modifiers. On the Mac, in particular, mouse wheel events are received at a 600 // modifiers. On the Mac, in particular, mouse wheel events are received at a
596 // high rate; not waiting for the ack results in jankiness, and using the same 601 // high rate; not waiting for the ack results in jankiness, and using the same
597 // mechanism as for mouse moves (just dropping old events when multiple ones 602 // mechanism as for mouse moves (just dropping old events when multiple ones
598 // would be queued) results in very slow scrolling. 603 // would be queued) results in very slow scrolling.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 682
678 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; 683 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_;
679 684
680 // The last scroll offset of the render widget. 685 // The last scroll offset of the render widget.
681 gfx::Point last_scroll_offset_; 686 gfx::Point last_scroll_offset_;
682 687
683 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); 688 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
684 }; 689 };
685 690
686 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 691 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host.cc ('k') | content/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698