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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
489 // Notification that the user has made some kind of input that could | 489 // Notification that the user has made some kind of input that could |
490 // perform an action. The gestures that count are 1) any mouse down | 490 // perform an action. The gestures that count are 1) any mouse down |
491 // event and 2) enter or space key presses. | 491 // event and 2) enter or space key presses. |
492 virtual void OnUserGesture() {} | 492 virtual void OnUserGesture() {} |
493 | 493 |
494 // Callbacks for notification when the renderer becomes unresponsive to user | 494 // Callbacks for notification when the renderer becomes unresponsive to user |
495 // input events, and subsequently responsive again. | 495 // input events, and subsequently responsive again. |
496 virtual void NotifyRendererUnresponsive() {} | 496 virtual void NotifyRendererUnresponsive() {} |
497 virtual void NotifyRendererResponsive() {} | 497 virtual void NotifyRendererResponsive() {} |
498 | 498 |
499 // Called when auto-size resulted in the render size changing. | |
500 virtual void OnRenderSizeChanged(const gfx::Size& size) {} | |
501 | |
499 // --------------------------------------------------------------------------- | 502 // --------------------------------------------------------------------------- |
500 | 503 |
501 // RenderViewHost overrides this method to impose further restrictions on when | 504 // RenderViewHost overrides this method to impose further restrictions on when |
502 // to allow mouse lock. | 505 // to allow mouse lock. |
503 // Once the request is approved or rejected, GotResponseToLockMouseRequest() | 506 // Once the request is approved or rejected, GotResponseToLockMouseRequest() |
504 // will be called. | 507 // will be called. |
505 virtual void RequestToLockMouse(); | 508 virtual void RequestToLockMouse(); |
506 | 509 |
507 void RejectMouseLockOrUnlockIfNecessary(); | 510 void RejectMouseLockOrUnlockIfNecessary(); |
508 bool IsMouseLocked() const; | 511 bool IsMouseLocked() const; |
509 | 512 |
510 // RenderViewHost overrides this method to report when in fullscreen mode. | 513 // RenderViewHost overrides this method to report when in fullscreen mode. |
511 virtual bool IsFullscreen() const; | 514 virtual bool IsFullscreen() const; |
512 | 515 |
516 // Indicates if the render widget host should track the render widget's size | |
517 // as opposed to visa versa. | |
518 void SetShouldAutoSize(bool enable); | |
darin (slow to review)
2011/12/02 05:48:24
elsewhere, you say "auto-resize", here you say "au
| |
519 | |
513 protected: | 520 protected: |
514 // true if a renderer has once been valid. We use this flag to display a sad | 521 // true if a renderer has once been valid. We use this flag to display a sad |
515 // tab only when we lose our renderer and not if a paint occurs during | 522 // tab only when we lose our renderer and not if a paint occurs during |
516 // initialization. | 523 // initialization. |
517 bool renderer_initialized_; | 524 bool renderer_initialized_; |
518 | 525 |
519 private: | 526 private: |
520 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); | 527 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); |
521 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash); | 528 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash); |
522 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint); | 529 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
667 // hand is updated when the resize message is sent. This is very similar to | 674 // hand is updated when the resize message is sent. This is very similar to |
668 // |resize_ack_pending_|, but the latter is not set if the new size has width | 675 // |resize_ack_pending_|, but the latter is not set if the new size has width |
669 // or height zero, which is why we need this too. | 676 // or height zero, which is why we need this too. |
670 gfx::Size in_flight_size_; | 677 gfx::Size in_flight_size_; |
671 | 678 |
672 // The reserved area we last sent to the renderer. |current_reserved_rect_| | 679 // The reserved area we last sent to the renderer. |current_reserved_rect_| |
673 // is only updated once the resize message has been ack'd. This on the other | 680 // is only updated once the resize message has been ack'd. This on the other |
674 // hand is updated when the resize message is sent. | 681 // hand is updated when the resize message is sent. |
675 gfx::Rect in_flight_reserved_rect_; | 682 gfx::Rect in_flight_reserved_rect_; |
676 | 683 |
684 // True if the render widget host should track the render widget's size as | |
685 // opposed to visa versa. | |
686 bool should_auto_size_; | |
687 | |
677 // True if a mouse move event was sent to the render view and we are waiting | 688 // True if a mouse move event was sent to the render view and we are waiting |
678 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. | 689 // for a corresponding ViewHostMsg_HandleInputEvent_ACK message. |
679 bool mouse_move_pending_; | 690 bool mouse_move_pending_; |
680 | 691 |
681 // The next mouse move event to send (only non-null while mouse_move_pending_ | 692 // The next mouse move event to send (only non-null while mouse_move_pending_ |
682 // is true). | 693 // is true). |
683 scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_; | 694 scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_; |
684 | 695 |
685 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent | 696 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent |
686 // and we are waiting for a corresponding ack. | 697 // and we are waiting for a corresponding ack. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
796 gfx::Point last_scroll_offset_; | 807 gfx::Point last_scroll_offset_; |
797 | 808 |
798 bool pending_mouse_lock_request_; | 809 bool pending_mouse_lock_request_; |
799 | 810 |
800 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; | 811 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; |
801 | 812 |
802 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 813 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
803 }; | 814 }; |
804 | 815 |
805 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 816 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |