| OLD | NEW |
| 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 bool GotResponseToLockMouseRequest(bool allowed); | 353 bool GotResponseToLockMouseRequest(bool allowed); |
| 354 | 354 |
| 355 // Called by the view in response to AcceleratedSurfaceBuffersSwapped. | 355 // Called by the view in response to AcceleratedSurfaceBuffersSwapped. |
| 356 static void AcknowledgeSwapBuffers(int32 route_id, int gpu_host_id); | 356 static void AcknowledgeSwapBuffers(int32 route_id, int gpu_host_id); |
| 357 static void AcknowledgePostSubBuffer(int32 route_id, int gpu_host_id); | 357 static void AcknowledgePostSubBuffer(int32 route_id, int gpu_host_id); |
| 358 | 358 |
| 359 // Signals that the compositing surface was updated, e.g. after a lost context | 359 // Signals that the compositing surface was updated, e.g. after a lost context |
| 360 // event. | 360 // event. |
| 361 void CompositingSurfaceUpdated(); | 361 void CompositingSurfaceUpdated(); |
| 362 | 362 |
| 363 void set_allow_privileged_mouse_lock(bool allow) { |
| 364 allow_privileged_mouse_lock_ = allow; |
| 365 } |
| 366 |
| 363 protected: | 367 protected: |
| 364 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; | 368 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
| 365 | 369 |
| 366 // Internal implementation of the public Forward*Event() methods. | 370 // Internal implementation of the public Forward*Event() methods. |
| 367 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 371 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
| 368 int event_size, bool is_keyboard_shortcut); | 372 int event_size, bool is_keyboard_shortcut); |
| 369 | 373 |
| 370 // Called when we receive a notification indicating that the renderer | 374 // Called when we receive a notification indicating that the renderer |
| 371 // process has gone. This will reset our state so that our state will be | 375 // process has gone. This will reset our state so that our state will be |
| 372 // consistent if a new renderer is created. | 376 // consistent if a new renderer is created. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 void OnMsgDidChangeNumTouchEvents(int count); | 481 void OnMsgDidChangeNumTouchEvents(int count); |
| 478 | 482 |
| 479 void OnMsgSetCursor(const WebCursor& cursor); | 483 void OnMsgSetCursor(const WebCursor& cursor); |
| 480 void OnMsgTextInputStateChanged(ui::TextInputType type, | 484 void OnMsgTextInputStateChanged(ui::TextInputType type, |
| 481 bool can_compose_inline); | 485 bool can_compose_inline); |
| 482 void OnMsgImeCompositionRangeChanged(const ui::Range& range); | 486 void OnMsgImeCompositionRangeChanged(const ui::Range& range); |
| 483 void OnMsgImeCancelComposition(); | 487 void OnMsgImeCancelComposition(); |
| 484 | 488 |
| 485 void OnMsgDidActivateAcceleratedCompositing(bool activated); | 489 void OnMsgDidActivateAcceleratedCompositing(bool activated); |
| 486 | 490 |
| 487 void OnMsgLockMouse(bool user_gesture, bool last_unlocked_by_target); | 491 void OnMsgLockMouse(bool user_gesture, |
| 492 bool last_unlocked_by_target, |
| 493 bool privileged); |
| 488 void OnMsgUnlockMouse(); | 494 void OnMsgUnlockMouse(); |
| 489 | 495 |
| 490 #if defined(OS_POSIX) || defined(USE_AURA) | 496 #if defined(OS_POSIX) || defined(USE_AURA) |
| 491 void OnMsgGetScreenInfo(gfx::NativeViewId view, | 497 void OnMsgGetScreenInfo(gfx::NativeViewId view, |
| 492 WebKit::WebScreenInfo* results); | 498 WebKit::WebScreenInfo* results); |
| 493 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); | 499 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); |
| 494 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); | 500 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); |
| 495 #endif | 501 #endif |
| 496 #if defined(OS_MACOSX) | 502 #if defined(OS_MACOSX) |
| 497 void OnMsgPluginFocusChanged(bool focused, int plugin_id); | 503 void OnMsgPluginFocusChanged(bool focused, int plugin_id); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // switching back to the original tab, because the content may already be | 710 // switching back to the original tab, because the content may already be |
| 705 // changed. | 711 // changed. |
| 706 bool suppress_next_char_events_; | 712 bool suppress_next_char_events_; |
| 707 | 713 |
| 708 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; | 714 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; |
| 709 | 715 |
| 710 // The last scroll offset of the render widget. | 716 // The last scroll offset of the render widget. |
| 711 gfx::Point last_scroll_offset_; | 717 gfx::Point last_scroll_offset_; |
| 712 | 718 |
| 713 bool pending_mouse_lock_request_; | 719 bool pending_mouse_lock_request_; |
| 720 bool allow_privileged_mouse_lock_; |
| 714 | 721 |
| 715 // Keeps track of whether the webpage has any touch event handler. If it does, | 722 // Keeps track of whether the webpage has any touch event handler. If it does, |
| 716 // then touch events are sent to the renderer. Otherwise, the touch events are | 723 // then touch events are sent to the renderer. Otherwise, the touch events are |
| 717 // not sent to the renderer. | 724 // not sent to the renderer. |
| 718 bool has_touch_handler_; | 725 bool has_touch_handler_; |
| 719 | 726 |
| 720 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 727 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 721 | 728 |
| 722 scoped_ptr<TapSuppressionController> tap_suppression_controller_; | 729 scoped_ptr<TapSuppressionController> tap_suppression_controller_; |
| 723 | 730 |
| 724 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 731 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 725 }; | 732 }; |
| 726 | 733 |
| 727 } // namespace content | 734 } // namespace content |
| 728 | 735 |
| 729 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 736 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |