| 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 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/process_util.h" | 21 #include "base/process_util.h" |
| 22 #include "base/string16.h" | 22 #include "base/string16.h" |
| 23 #include "base/time.h" | 23 #include "base/time.h" |
| 24 #include "base/timer.h" | 24 #include "base/timer.h" |
| 25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "cc/debug/latency_info.h" | |
| 27 #include "content/browser/renderer_host/event_with_latency_info.h" | 26 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 28 #include "content/browser/renderer_host/smooth_scroll_gesture_controller.h" | 27 #include "content/browser/renderer_host/smooth_scroll_gesture_controller.h" |
| 29 #include "content/common/view_message_enums.h" | 28 #include "content/common/view_message_enums.h" |
| 30 #include "content/port/common/input_event_ack_state.h" | 29 #include "content/port/common/input_event_ack_state.h" |
| 31 #include "content/public/browser/render_widget_host.h" | 30 #include "content/public/browser/render_widget_host.h" |
| 32 #include "content/public/common/page_zoom.h" | 31 #include "content/public/common/page_zoom.h" |
| 33 #include "ipc/ipc_listener.h" | 32 #include "ipc/ipc_listener.h" |
| 34 #include "ui/base/ime/text_input_type.h" | 33 #include "ui/base/ime/text_input_type.h" |
| 34 #include "ui/base/latency_info.h" |
| 35 #include "ui/gfx/native_widget_types.h" | 35 #include "ui/gfx/native_widget_types.h" |
| 36 | 36 |
| 37 class WebCursor; | 37 class WebCursor; |
| 38 struct AcceleratedSurfaceMsg_BufferPresented_Params; | 38 struct AcceleratedSurfaceMsg_BufferPresented_Params; |
| 39 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 39 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
| 40 struct ViewHostMsg_UpdateRect_Params; | 40 struct ViewHostMsg_UpdateRect_Params; |
| 41 struct ViewHostMsg_TextInputState_Params; | 41 struct ViewHostMsg_TextInputState_Params; |
| 42 struct ViewHostMsg_BeginSmoothScroll_Params; | 42 struct ViewHostMsg_BeginSmoothScroll_Params; |
| 43 | 43 |
| 44 namespace base { | 44 namespace base { |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 void SetOverscrollControllerEnabled(bool enabled); | 472 void SetOverscrollControllerEnabled(bool enabled); |
| 473 | 473 |
| 474 // Suppreses future char events until a keydown. See | 474 // Suppreses future char events until a keydown. See |
| 475 // suppress_next_char_events_. | 475 // suppress_next_char_events_. |
| 476 void SuppressNextCharEvents(); | 476 void SuppressNextCharEvents(); |
| 477 | 477 |
| 478 // Indicates whether the renderer drives the RenderWidgetHosts's size or the | 478 // Indicates whether the renderer drives the RenderWidgetHosts's size or the |
| 479 // other way around. | 479 // other way around. |
| 480 bool should_auto_resize() { return should_auto_resize_; } | 480 bool should_auto_resize() { return should_auto_resize_; } |
| 481 | 481 |
| 482 void FrameSwapped(const cc::LatencyInfo& latency_info); | 482 void FrameSwapped(const ui::LatencyInfo& latency_info); |
| 483 | 483 |
| 484 // Returns the ID that uniquely describes this component to the latency | 484 // Returns the ID that uniquely describes this component to the latency |
| 485 // subsystem. | 485 // subsystem. |
| 486 int64 GetLatencyComponentId(); | 486 int64 GetLatencyComponentId(); |
| 487 | 487 |
| 488 protected: | 488 protected: |
| 489 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; | 489 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
| 490 | 490 |
| 491 // Transmits the given input event. This is an internal helper for | 491 // Transmits the given input event. This is an internal helper for |
| 492 // |ForwardInputEvent()| and should not be used directly from elsewhere. | 492 // |ForwardInputEvent()| and should not be used directly from elsewhere. |
| 493 void SendInputEvent(const WebKit::WebInputEvent& input_event, | 493 void SendInputEvent(const WebKit::WebInputEvent& input_event, |
| 494 int event_size, const cc::LatencyInfo& latency_info, | 494 int event_size, const ui::LatencyInfo& latency_info, |
| 495 bool is_keyboard_shortcut); | 495 bool is_keyboard_shortcut); |
| 496 | 496 |
| 497 // Internal implementation of the public Forward*Event() methods. | 497 // Internal implementation of the public Forward*Event() methods. |
| 498 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 498 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
| 499 int event_size, const cc::LatencyInfo& latency_info, | 499 int event_size, const ui::LatencyInfo& latency_info, |
| 500 bool is_keyboard_shortcut); | 500 bool is_keyboard_shortcut); |
| 501 | 501 |
| 502 // Internal forwarding implementations that take a LatencyInfo. | 502 // Internal forwarding implementations that take a LatencyInfo. |
| 503 virtual void ForwardMouseEventWithLatencyInfo( | 503 virtual void ForwardMouseEventWithLatencyInfo( |
| 504 const MouseEventWithLatencyInfo& mouse_event); | 504 const MouseEventWithLatencyInfo& mouse_event); |
| 505 virtual void ForwardWheelEventWithLatencyInfo( | 505 virtual void ForwardWheelEventWithLatencyInfo( |
| 506 const WebKit::WebMouseWheelEvent& wheel_event, | 506 const WebKit::WebMouseWheelEvent& wheel_event, |
| 507 const cc::LatencyInfo& latency_info); | 507 const ui::LatencyInfo& latency_info); |
| 508 | 508 |
| 509 // Create a LatencyInfo struct for a new input event that was just received. | 509 // Create a LatencyInfo struct for a new input event that was just received. |
| 510 cc::LatencyInfo NewInputLatencyInfo(); | 510 ui::LatencyInfo NewInputLatencyInfo(); |
| 511 | 511 |
| 512 // Called when we receive a notification indicating that the renderer | 512 // Called when we receive a notification indicating that the renderer |
| 513 // process has gone. This will reset our state so that our state will be | 513 // process has gone. This will reset our state so that our state will be |
| 514 // consistent if a new renderer is created. | 514 // consistent if a new renderer is created. |
| 515 void RendererExited(base::TerminationStatus status, int exit_code); | 515 void RendererExited(base::TerminationStatus status, int exit_code); |
| 516 | 516 |
| 517 // Retrieves an id the renderer can use to refer to its view. | 517 // Retrieves an id the renderer can use to refer to its view. |
| 518 // This is used for various IPC messages, including plugins. | 518 // This is used for various IPC messages, including plugins. |
| 519 gfx::NativeViewId GetNativeViewId() const; | 519 gfx::NativeViewId GetNativeViewId() const; |
| 520 | 520 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; | 907 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; |
| 908 | 908 |
| 909 int64 last_input_number_; | 909 int64 last_input_number_; |
| 910 | 910 |
| 911 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 911 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 912 }; | 912 }; |
| 913 | 913 |
| 914 } // namespace content | 914 } // namespace content |
| 915 | 915 |
| 916 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 916 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |