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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 // Called to notify the RenderWidget that its associated native window got | 186 // Called to notify the RenderWidget that its associated native window got |
187 // focused. | 187 // focused. |
188 virtual void GotFocus(); | 188 virtual void GotFocus(); |
189 | 189 |
190 // Tells the renderer it got/lost focus. | 190 // Tells the renderer it got/lost focus. |
191 void Focus(); | 191 void Focus(); |
192 void Blur(); | 192 void Blur(); |
193 virtual void LostCapture(); | 193 virtual void LostCapture(); |
194 | 194 |
| 195 // Called to notify the RenderWidget that it has lost the mouse lock. |
| 196 virtual void LostMouseLock(); |
| 197 |
195 // Tells us whether the page is rendered directly via the GPU process. | 198 // Tells us whether the page is rendered directly via the GPU process. |
196 bool is_accelerated_compositing_active() { | 199 bool is_accelerated_compositing_active() { |
197 return is_accelerated_compositing_active_; | 200 return is_accelerated_compositing_active_; |
198 } | 201 } |
199 | 202 |
200 // Notifies the RenderWidgetHost that the View was destroyed. | 203 // Notifies the RenderWidgetHost that the View was destroyed. |
201 void ViewDestroyed(); | 204 void ViewDestroyed(); |
202 | 205 |
203 // Indicates if the page has finished loading. | 206 // Indicates if the page has finished loading. |
204 void SetIsLoading(bool is_loading); | 207 void SetIsLoading(bool is_loading); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // RenderViewHostDelegate). The gestures that count are 1) any mouse down | 417 // RenderViewHostDelegate). The gestures that count are 1) any mouse down |
415 // event and 2) enter or space key presses. | 418 // event and 2) enter or space key presses. |
416 virtual void OnUserGesture() {} | 419 virtual void OnUserGesture() {} |
417 | 420 |
418 // Callbacks for notification when the renderer becomes unresponsive to user | 421 // Callbacks for notification when the renderer becomes unresponsive to user |
419 // input events, and subsequently responsive again. RenderViewHost overrides | 422 // input events, and subsequently responsive again. RenderViewHost overrides |
420 // these to tell its delegate to show the user a warning. | 423 // these to tell its delegate to show the user a warning. |
421 virtual void NotifyRendererUnresponsive() {} | 424 virtual void NotifyRendererUnresponsive() {} |
422 virtual void NotifyRendererResponsive() {} | 425 virtual void NotifyRendererResponsive() {} |
423 | 426 |
| 427 bool IsMouseLocked() const; |
| 428 |
424 protected: | 429 protected: |
425 // true if a renderer has once been valid. We use this flag to display a sad | 430 // true if a renderer has once been valid. We use this flag to display a sad |
426 // tab only when we lose our renderer and not if a paint occurs during | 431 // tab only when we lose our renderer and not if a paint occurs during |
427 // initialization. | 432 // initialization. |
428 bool renderer_initialized_; | 433 bool renderer_initialized_; |
429 | 434 |
430 private: | 435 private: |
431 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); | 436 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); |
432 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash); | 437 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash); |
433 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint); | 438 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint); |
(...skipping 26 matching lines...) Expand all Loading... |
460 | 465 |
461 void OnMsgSetCursor(const WebCursor& cursor); | 466 void OnMsgSetCursor(const WebCursor& cursor); |
462 void OnMsgImeUpdateTextInputState(ui::TextInputType type, | 467 void OnMsgImeUpdateTextInputState(ui::TextInputType type, |
463 bool can_compose_inline, | 468 bool can_compose_inline, |
464 const gfx::Rect& caret_rect); | 469 const gfx::Rect& caret_rect); |
465 void OnMsgImeCompositionRangeChanged(const ui::Range& range); | 470 void OnMsgImeCompositionRangeChanged(const ui::Range& range); |
466 void OnMsgImeCancelComposition(); | 471 void OnMsgImeCancelComposition(); |
467 | 472 |
468 void OnMsgDidActivateAcceleratedCompositing(bool activated); | 473 void OnMsgDidActivateAcceleratedCompositing(bool activated); |
469 | 474 |
| 475 void OnMsgLockMouse(); |
| 476 void OnMsgUnlockMouse(); |
| 477 |
470 #if defined(OS_POSIX) | 478 #if defined(OS_POSIX) |
471 void OnMsgGetScreenInfo(gfx::NativeViewId view, | 479 void OnMsgGetScreenInfo(gfx::NativeViewId view, |
472 WebKit::WebScreenInfo* results); | 480 WebKit::WebScreenInfo* results); |
473 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); | 481 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); |
474 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); | 482 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); |
475 #endif | 483 #endif |
476 #if defined(OS_MACOSX) | 484 #if defined(OS_MACOSX) |
477 void OnMsgPluginFocusChanged(bool focused, int plugin_id); | 485 void OnMsgPluginFocusChanged(bool focused, int plugin_id); |
478 void OnMsgStartPluginIme(); | 486 void OnMsgStartPluginIme(); |
479 void OnAllocateFakePluginWindowHandle(bool opaque, | 487 void OnAllocateFakePluginWindowHandle(bool opaque, |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 | 683 |
676 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; | 684 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; |
677 | 685 |
678 // The last scroll offset of the render widget. | 686 // The last scroll offset of the render widget. |
679 gfx::Point last_scroll_offset_; | 687 gfx::Point last_scroll_offset_; |
680 | 688 |
681 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 689 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
682 }; | 690 }; |
683 | 691 |
684 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 692 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |