| 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 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "cc/trees/layer_tree_host.h" | 31 #include "cc/trees/layer_tree_host.h" |
| 32 #include "content/common/content_switches_internal.h" | 32 #include "content/common/content_switches_internal.h" |
| 33 #include "content/common/drag_event_source_info.h" | 33 #include "content/common/drag_event_source_info.h" |
| 34 #include "content/common/drag_messages.h" | 34 #include "content/common/drag_messages.h" |
| 35 #include "content/common/input/synthetic_gesture_packet.h" | 35 #include "content/common/input/synthetic_gesture_packet.h" |
| 36 #include "content/common/input_messages.h" | 36 #include "content/common/input_messages.h" |
| 37 #include "content/common/render_message_filter.mojom.h" | 37 #include "content/common/render_message_filter.mojom.h" |
| 38 #include "content/common/swapped_out_messages.h" | 38 #include "content/common/swapped_out_messages.h" |
| 39 #include "content/common/text_input_state.h" | 39 #include "content/common/text_input_state.h" |
| 40 #include "content/common/view_messages.h" | 40 #include "content/common/view_messages.h" |
| 41 #include "content/public/common/content_client.h" |
| 41 #include "content/public/common/content_features.h" | 42 #include "content/public/common/content_features.h" |
| 42 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
| 43 #include "content/public/common/context_menu_params.h" | 44 #include "content/public/common/context_menu_params.h" |
| 44 #include "content/public/common/drop_data.h" | 45 #include "content/public/common/drop_data.h" |
| 46 #include "content/public/renderer/content_renderer_client.h" |
| 45 #include "content/renderer/cursor_utils.h" | 47 #include "content/renderer/cursor_utils.h" |
| 46 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" | 48 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" |
| 47 #include "content/renderer/drop_data_builder.h" | 49 #include "content/renderer/drop_data_builder.h" |
| 48 #include "content/renderer/external_popup_menu.h" | 50 #include "content/renderer/external_popup_menu.h" |
| 49 #include "content/renderer/gpu/frame_swap_message_queue.h" | 51 #include "content/renderer/gpu/frame_swap_message_queue.h" |
| 50 #include "content/renderer/gpu/queue_message_swap_promise.h" | 52 #include "content/renderer/gpu/queue_message_swap_promise.h" |
| 51 #include "content/renderer/gpu/render_widget_compositor.h" | 53 #include "content/renderer/gpu/render_widget_compositor.h" |
| 52 #include "content/renderer/ime_event_guard.h" | 54 #include "content/renderer/ime_event_guard.h" |
| 53 #include "content/renderer/input/input_handler_manager.h" | 55 #include "content/renderer/input/input_handler_manager.h" |
| 54 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 56 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| (...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 GetWebWidget()->selectionTextDirection(params.focus_dir, | 1978 GetWebWidget()->selectionTextDirection(params.focus_dir, |
| 1977 params.anchor_dir); | 1979 params.anchor_dir); |
| 1978 params.is_anchor_first = GetWebWidget()->isSelectionAnchorFirst(); | 1980 params.is_anchor_first = GetWebWidget()->isSelectionAnchorFirst(); |
| 1979 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 1981 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
| 1980 } | 1982 } |
| 1981 } | 1983 } |
| 1982 | 1984 |
| 1983 UpdateCompositionInfo(false /* not an immediate request */); | 1985 UpdateCompositionInfo(false /* not an immediate request */); |
| 1984 } | 1986 } |
| 1985 | 1987 |
| 1986 void RenderWidget::SetDeviceColorProfileForTesting( | |
| 1987 const gfx::ICCProfile& color_profile) { | |
| 1988 if (owner_delegate_) | |
| 1989 owner_delegate_->RenderWidgetDidSetColorProfile(color_profile); | |
| 1990 } | |
| 1991 | |
| 1992 void RenderWidget::DidAutoResize(const gfx::Size& new_size) { | 1988 void RenderWidget::DidAutoResize(const gfx::Size& new_size) { |
| 1993 WebRect new_size_in_window(0, 0, new_size.width(), new_size.height()); | 1989 WebRect new_size_in_window(0, 0, new_size.width(), new_size.height()); |
| 1994 convertViewportToWindow(&new_size_in_window); | 1990 convertViewportToWindow(&new_size_in_window); |
| 1995 if (size_.width() != new_size_in_window.width || | 1991 if (size_.width() != new_size_in_window.width || |
| 1996 size_.height() != new_size_in_window.height) { | 1992 size_.height() != new_size_in_window.height) { |
| 1997 size_ = gfx::Size(new_size_in_window.width, new_size_in_window.height); | 1993 size_ = gfx::Size(new_size_in_window.width, new_size_in_window.height); |
| 1998 | 1994 |
| 1999 if (resizing_mode_selector_->is_synchronous_mode()) { | 1995 if (resizing_mode_selector_->is_synchronous_mode()) { |
| 2000 gfx::Rect new_pos(windowRect().x, windowRect().y, | 1996 gfx::Rect new_pos(windowRect().x, windowRect().y, |
| 2001 size_.width(), size_.height()); | 1997 size_.width(), size_.height()); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 #if BUILDFLAG(ENABLE_PLUGINS) | 2062 #if BUILDFLAG(ENABLE_PLUGINS) |
| 2067 if (focused_pepper_plugin_) | 2063 if (focused_pepper_plugin_) |
| 2068 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); | 2064 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); |
| 2069 #endif | 2065 #endif |
| 2070 return true; | 2066 return true; |
| 2071 } | 2067 } |
| 2072 | 2068 |
| 2073 blink::WebScreenInfo RenderWidget::screenInfo() { | 2069 blink::WebScreenInfo RenderWidget::screenInfo() { |
| 2074 blink::WebScreenInfo web_screen_info; | 2070 blink::WebScreenInfo web_screen_info; |
| 2075 web_screen_info.deviceScaleFactor = screen_info_.device_scale_factor; | 2071 web_screen_info.deviceScaleFactor = screen_info_.device_scale_factor; |
| 2072 web_screen_info.iccProfile = screen_info_.icc_profile; |
| 2076 web_screen_info.depth = screen_info_.depth; | 2073 web_screen_info.depth = screen_info_.depth; |
| 2077 web_screen_info.depthPerComponent = screen_info_.depth_per_component; | 2074 web_screen_info.depthPerComponent = screen_info_.depth_per_component; |
| 2078 web_screen_info.isMonochrome = screen_info_.is_monochrome; | 2075 web_screen_info.isMonochrome = screen_info_.is_monochrome; |
| 2079 web_screen_info.rect = blink::WebRect(screen_info_.rect); | 2076 web_screen_info.rect = blink::WebRect(screen_info_.rect); |
| 2080 web_screen_info.availableRect = blink::WebRect(screen_info_.available_rect); | 2077 web_screen_info.availableRect = blink::WebRect(screen_info_.available_rect); |
| 2081 switch (screen_info_.orientation_type) { | 2078 switch (screen_info_.orientation_type) { |
| 2082 case SCREEN_ORIENTATION_VALUES_PORTRAIT_PRIMARY: | 2079 case SCREEN_ORIENTATION_VALUES_PORTRAIT_PRIMARY: |
| 2083 web_screen_info.orientationType = | 2080 web_screen_info.orientationType = |
| 2084 blink::WebScreenOrientationPortraitPrimary; | 2081 blink::WebScreenOrientationPortraitPrimary; |
| 2085 break; | 2082 break; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 // browser side (https://crbug.com/669219). | 2280 // browser side (https://crbug.com/669219). |
| 2284 // If there is no WebFrameWidget, then there will be no | 2281 // If there is no WebFrameWidget, then there will be no |
| 2285 // InputMethodControllers for a WebLocalFrame. | 2282 // InputMethodControllers for a WebLocalFrame. |
| 2286 return nullptr; | 2283 return nullptr; |
| 2287 } | 2284 } |
| 2288 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2285 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
| 2289 ->getActiveWebInputMethodController(); | 2286 ->getActiveWebInputMethodController(); |
| 2290 } | 2287 } |
| 2291 | 2288 |
| 2292 } // namespace content | 2289 } // namespace content |
| OLD | NEW |