OLD | NEW |
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 467 |
468 // Called to handled a keyboard event before sending it to the renderer. | 468 // Called to handled a keyboard event before sending it to the renderer. |
469 // This is overridden by RenderView to send upwards to its delegate. | 469 // This is overridden by RenderView to send upwards to its delegate. |
470 // Returns true if the event was handled, and then the keyboard event will | 470 // Returns true if the event was handled, and then the keyboard event will |
471 // not be sent to the renderer anymore. Otherwise, if the |event| would | 471 // not be sent to the renderer anymore. Otherwise, if the |event| would |
472 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, | 472 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
473 // |*is_keyboard_shortcut| should be set to true. | 473 // |*is_keyboard_shortcut| should be set to true. |
474 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 474 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
475 bool* is_keyboard_shortcut); | 475 bool* is_keyboard_shortcut); |
476 | 476 |
477 // Called when a keyboard event was not processed by the renderer. This is | 477 // "RenderWidgetHostDelegate" ------------------------------------------------ |
478 // overridden by RenderView to send upwards to its delegate. | 478 // There is no RenderWidgetHostDelegate but the following methods serve the |
| 479 // same purpose. They are overridden by RenderView to send upwards to its |
| 480 // delegate. |
| 481 |
| 482 // Called when a keyboard event was not processed by the renderer. |
479 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 483 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
480 | 484 |
481 // Called when a mousewheel event was not processed by the renderer. This is | 485 // Called when a mousewheel event was not processed by the renderer. |
482 // overridden by RenderView to send upwards to its delegate. | |
483 virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) {} | 486 virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) {} |
484 | 487 |
485 // Notification that the user has made some kind of input that could | 488 // Notification that the user has made some kind of input that could |
486 // perform an action. The render view host overrides this to forward the | 489 // perform an action. The gestures that count are 1) any mouse down |
487 // information to its delegate (see corresponding function in | |
488 // RenderViewHostDelegate). The gestures that count are 1) any mouse down | |
489 // event and 2) enter or space key presses. | 490 // event and 2) enter or space key presses. |
490 virtual void OnUserGesture() {} | 491 virtual void OnUserGesture() {} |
491 | 492 |
492 // Callbacks for notification when the renderer becomes unresponsive to user | 493 // Callbacks for notification when the renderer becomes unresponsive to user |
493 // input events, and subsequently responsive again. RenderViewHost overrides | 494 // input events, and subsequently responsive again. |
494 // these to tell its delegate to show the user a warning. | |
495 virtual void NotifyRendererUnresponsive() {} | 495 virtual void NotifyRendererUnresponsive() {} |
496 virtual void NotifyRendererResponsive() {} | 496 virtual void NotifyRendererResponsive() {} |
497 | 497 |
| 498 // --------------------------------------------------------------------------- |
| 499 |
498 // RenderViewHost overrides this method to impose further restrictions on when | 500 // RenderViewHost overrides this method to impose further restrictions on when |
499 // to allow mouse lock. | 501 // to allow mouse lock. |
500 // Once the request is approved or rejected, GotResponseToLockMouseRequest() | 502 // Once the request is approved or rejected, GotResponseToLockMouseRequest() |
501 // will be called. | 503 // will be called. |
502 virtual void RequestToLockMouse(); | 504 virtual void RequestToLockMouse(); |
503 | 505 |
504 void RejectMouseLockOrUnlockIfNecessary(); | 506 void RejectMouseLockOrUnlockIfNecessary(); |
505 bool IsMouseLocked() const; | 507 bool IsMouseLocked() const; |
506 | 508 |
507 // RenderViewHost overrides this method to report when in fullscreen mode. | 509 // RenderViewHost overrides this method to report when in fullscreen mode. |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 gfx::Point last_scroll_offset_; | 780 gfx::Point last_scroll_offset_; |
779 | 781 |
780 bool pending_mouse_lock_request_; | 782 bool pending_mouse_lock_request_; |
781 | 783 |
782 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; | 784 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; |
783 | 785 |
784 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 786 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
785 }; | 787 }; |
786 | 788 |
787 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 789 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |