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_UpdateRect_Params; | 39 struct ViewHostMsg_UpdateRect_Params; |
40 struct ViewHostMsg_TextInputState_Params; | 40 struct ViewHostMsg_TextInputState_Params; |
41 struct ViewHostMsg_BeginSmoothScroll_Params; | 41 struct ViewHostMsg_BeginSmoothScroll_Params; |
42 | 42 |
43 namespace base { | 43 namespace base { |
44 class TimeTicks; | 44 class TimeTicks; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 void SetOverscrollControllerEnabled(bool enabled); | 469 void SetOverscrollControllerEnabled(bool enabled); |
470 | 470 |
471 // Suppreses future char events until a keydown. See | 471 // Suppreses future char events until a keydown. See |
472 // suppress_next_char_events_. | 472 // suppress_next_char_events_. |
473 void SuppressNextCharEvents(); | 473 void SuppressNextCharEvents(); |
474 | 474 |
475 // Indicates whether the renderer drives the RenderWidgetHosts's size or the | 475 // Indicates whether the renderer drives the RenderWidgetHosts's size or the |
476 // other way around. | 476 // other way around. |
477 bool should_auto_resize() { return should_auto_resize_; } | 477 bool should_auto_resize() { return should_auto_resize_; } |
478 | 478 |
479 void FrameSwapped(const cc::LatencyInfo& latency_info); | 479 void FrameSwapped(const ui::LatencyInfo& latency_info); |
480 | 480 |
481 // Returns the ID that uniquely describes this component to the latency | 481 // Returns the ID that uniquely describes this component to the latency |
482 // subsystem. | 482 // subsystem. |
483 int64 GetLatencyComponentId(); | 483 int64 GetLatencyComponentId(); |
484 | 484 |
485 protected: | 485 protected: |
486 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; | 486 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
487 | 487 |
488 // Transmits the given input event. This is an internal helper for | 488 // Transmits the given input event. This is an internal helper for |
489 // |ForwardInputEvent()| and should not be used directly from elsewhere. | 489 // |ForwardInputEvent()| and should not be used directly from elsewhere. |
490 void SendInputEvent(const WebKit::WebInputEvent& input_event, | 490 void SendInputEvent(const WebKit::WebInputEvent& input_event, |
491 int event_size, const cc::LatencyInfo& latency_info, | 491 int event_size, const ui::LatencyInfo& latency_info, |
492 bool is_keyboard_shortcut); | 492 bool is_keyboard_shortcut); |
493 | 493 |
494 // Internal implementation of the public Forward*Event() methods. | 494 // Internal implementation of the public Forward*Event() methods. |
495 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 495 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
496 int event_size, const cc::LatencyInfo& latency_info, | 496 int event_size, const ui::LatencyInfo& latency_info, |
497 bool is_keyboard_shortcut); | 497 bool is_keyboard_shortcut); |
498 | 498 |
499 // Internal forwarding implementations that take a LatencyInfo. | 499 // Internal forwarding implementations that take a LatencyInfo. |
500 virtual void ForwardMouseEventWithLatencyInfo( | 500 virtual void ForwardMouseEventWithLatencyInfo( |
501 const MouseEventWithLatencyInfo& mouse_event); | 501 const MouseEventWithLatencyInfo& mouse_event); |
502 virtual void ForwardWheelEventWithLatencyInfo( | 502 virtual void ForwardWheelEventWithLatencyInfo( |
503 const WebKit::WebMouseWheelEvent& wheel_event, | 503 const WebKit::WebMouseWheelEvent& wheel_event, |
504 const cc::LatencyInfo& latency_info); | 504 const ui::LatencyInfo& latency_info); |
505 | 505 |
506 // Create a LatencyInfo struct for a new input event that was just received. | 506 // Create a LatencyInfo struct for a new input event that was just received. |
507 cc::LatencyInfo NewInputLatencyInfo(); | 507 ui::LatencyInfo NewInputLatencyInfo(); |
508 | 508 |
509 // Called when we receive a notification indicating that the renderer | 509 // Called when we receive a notification indicating that the renderer |
510 // process has gone. This will reset our state so that our state will be | 510 // process has gone. This will reset our state so that our state will be |
511 // consistent if a new renderer is created. | 511 // consistent if a new renderer is created. |
512 void RendererExited(base::TerminationStatus status, int exit_code); | 512 void RendererExited(base::TerminationStatus status, int exit_code); |
513 | 513 |
514 // Retrieves an id the renderer can use to refer to its view. | 514 // Retrieves an id the renderer can use to refer to its view. |
515 // This is used for various IPC messages, including plugins. | 515 // This is used for various IPC messages, including plugins. |
516 gfx::NativeViewId GetNativeViewId() const; | 516 gfx::NativeViewId GetNativeViewId() const; |
517 | 517 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; | 905 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; |
906 | 906 |
907 int64 last_input_number_; | 907 int64 last_input_number_; |
908 | 908 |
909 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 909 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
910 }; | 910 }; |
911 | 911 |
912 } // namespace content | 912 } // namespace content |
913 | 913 |
914 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 914 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |