Chromium Code Reviews| 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_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/common/cursors/webcursor.h" | 20 #include "content/common/cursors/webcursor.h" |
| 21 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 21 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 22 #include "content/common/input/synthetic_gesture_params.h" | 22 #include "content/common/input/synthetic_gesture_params.h" |
| 23 #include "content/renderer/message_delivery_policy.h" | 23 #include "content/renderer/message_delivery_policy.h" |
| 24 #include "ipc/ipc_listener.h" | 24 #include "ipc/ipc_listener.h" |
| 25 #include "ipc/ipc_sender.h" | 25 #include "ipc/ipc_sender.h" |
| 26 #include "third_party/WebKit/public/platform/WebDisplayMode.h" | |
| 26 #include "third_party/WebKit/public/platform/WebRect.h" | 27 #include "third_party/WebKit/public/platform/WebRect.h" |
| 27 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 28 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 28 #include "third_party/WebKit/public/web/WebInputEvent.h" | 29 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 29 #include "third_party/WebKit/public/web/WebPopupType.h" | 30 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 30 #include "third_party/WebKit/public/web/WebTextDirection.h" | 31 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 31 #include "third_party/WebKit/public/web/WebTextInputInfo.h" | 32 #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
| 32 #include "third_party/WebKit/public/web/WebTouchAction.h" | 33 #include "third_party/WebKit/public/web/WebTouchAction.h" |
| 33 #include "third_party/WebKit/public/web/WebWidget.h" | 34 #include "third_party/WebKit/public/web/WebWidget.h" |
| 34 #include "third_party/WebKit/public/web/WebWidgetClient.h" | 35 #include "third_party/WebKit/public/web/WebWidgetClient.h" |
| 35 #include "third_party/skia/include/core/SkBitmap.h" | 36 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 | 117 |
| 117 // Creates a WebWidget based on the popup type. | 118 // Creates a WebWidget based on the popup type. |
| 118 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); | 119 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
| 119 | 120 |
| 120 int32 routing_id() const { return routing_id_; } | 121 int32 routing_id() const { return routing_id_; } |
| 121 int32 surface_id() const { return surface_id_; } | 122 int32 surface_id() const { return surface_id_; } |
| 122 CompositorDependencies* compositor_deps() const { return compositor_deps_; } | 123 CompositorDependencies* compositor_deps() const { return compositor_deps_; } |
| 123 blink::WebWidget* webwidget() const { return webwidget_; } | 124 blink::WebWidget* webwidget() const { return webwidget_; } |
| 124 gfx::Size size() const { return size_; } | 125 gfx::Size size() const { return size_; } |
| 125 bool has_focus() const { return has_focus_; } | 126 bool has_focus() const { return has_focus_; } |
| 126 bool is_fullscreen() const { return is_fullscreen_; } | 127 bool is_fullscreen() const { return is_fullscreen_; } |
|
miu
2015/03/31 01:37:49
I understand now why this is decoupled, but there'
| |
| 128 blink::WebDisplayMode display_mode() const { return display_mode_; } | |
| 127 bool is_hidden() const { return is_hidden_; } | 129 bool is_hidden() const { return is_hidden_; } |
| 128 bool handling_input_event() const { return handling_input_event_; } | 130 bool handling_input_event() const { return handling_input_event_; } |
| 129 // Temporary for debugging purposes... | 131 // Temporary for debugging purposes... |
| 130 bool closing() const { return closing_; } | 132 bool closing() const { return closing_; } |
| 131 bool is_swapped_out() { return is_swapped_out_; } | 133 bool is_swapped_out() { return is_swapped_out_; } |
| 132 ui::MenuSourceType context_menu_source_type() { | 134 ui::MenuSourceType context_menu_source_type() { |
| 133 return context_menu_source_type_; | 135 return context_menu_source_type_; |
| 134 } | 136 } |
| 135 bool has_host_context_menu_location() { | 137 bool has_host_context_menu_location() { |
| 136 return has_host_context_menu_location_; | 138 return has_host_context_menu_location_; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 void DoDeferredSetWindowRect(const blink::WebRect& pos); | 384 void DoDeferredSetWindowRect(const blink::WebRect& pos); |
| 383 | 385 |
| 384 // Resizes the render widget. | 386 // Resizes the render widget. |
| 385 void Resize(const gfx::Size& new_size, | 387 void Resize(const gfx::Size& new_size, |
| 386 const gfx::Size& physical_backing_size, | 388 const gfx::Size& physical_backing_size, |
| 387 bool top_controls_shrink_blink_size, | 389 bool top_controls_shrink_blink_size, |
| 388 float top_controls_height, | 390 float top_controls_height, |
| 389 const gfx::Size& visible_viewport_size, | 391 const gfx::Size& visible_viewport_size, |
| 390 const gfx::Rect& resizer_rect, | 392 const gfx::Rect& resizer_rect, |
| 391 bool is_fullscreen, | 393 bool is_fullscreen, |
| 394 blink::WebDisplayMode display_mode, | |
| 392 ResizeAck resize_ack); | 395 ResizeAck resize_ack); |
| 393 // Used to force the size of a window when running layout tests. | 396 // Used to force the size of a window when running layout tests. |
| 394 void SetWindowRectSynchronously(const gfx::Rect& new_window_rect); | 397 void SetWindowRectSynchronously(const gfx::Rect& new_window_rect); |
| 395 virtual void SetScreenMetricsEmulationParameters( | 398 virtual void SetScreenMetricsEmulationParameters( |
| 396 bool enabled, | 399 bool enabled, |
| 397 const blink::WebDeviceEmulationParams& params); | 400 const blink::WebDeviceEmulationParams& params); |
| 398 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 401 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 399 void SetExternalPopupOriginAdjustmentsForEmulation( | 402 void SetExternalPopupOriginAdjustmentsForEmulation( |
| 400 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator); | 403 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator); |
| 401 #endif | 404 #endif |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 654 | 657 |
| 655 // Indicates that we shouldn't bother generated paint events. | 658 // Indicates that we shouldn't bother generated paint events. |
| 656 bool is_hidden_; | 659 bool is_hidden_; |
| 657 | 660 |
| 658 // Indicates that we are never visible, so never produce graphical output. | 661 // Indicates that we are never visible, so never produce graphical output. |
| 659 bool never_visible_; | 662 bool never_visible_; |
| 660 | 663 |
| 661 // Indicates that we are in fullscreen mode. | 664 // Indicates that we are in fullscreen mode. |
| 662 bool is_fullscreen_; | 665 bool is_fullscreen_; |
| 663 | 666 |
| 667 // Indicates the display mode. | |
| 668 blink::WebDisplayMode display_mode_; | |
| 669 | |
| 664 // Indicates whether we have been focused/unfocused by the browser. | 670 // Indicates whether we have been focused/unfocused by the browser. |
| 665 bool has_focus_; | 671 bool has_focus_; |
| 666 | 672 |
| 667 // Are we currently handling an input event? | 673 // Are we currently handling an input event? |
| 668 bool handling_input_event_; | 674 bool handling_input_event_; |
| 669 | 675 |
| 670 // Are we currently handling an ime event? | 676 // Are we currently handling an ime event? |
| 671 bool handling_ime_event_; | 677 bool handling_ime_event_; |
| 672 | 678 |
| 673 // Type of the input event we are currently handling. | 679 // Type of the input event we are currently handling. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 ui::MenuSourceType context_menu_source_type_; | 808 ui::MenuSourceType context_menu_source_type_; |
| 803 bool has_host_context_menu_location_; | 809 bool has_host_context_menu_location_; |
| 804 gfx::Point host_context_menu_location_; | 810 gfx::Point host_context_menu_location_; |
| 805 | 811 |
| 806 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 812 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 807 }; | 813 }; |
| 808 | 814 |
| 809 } // namespace content | 815 } // namespace content |
| 810 | 816 |
| 811 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 817 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |