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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), | 441 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
442 can_compose_inline_(true), | 442 can_compose_inline_(true), |
443 has_composition_text_(false), | 443 has_composition_text_(false), |
444 accept_return_character_(false), | 444 accept_return_character_(false), |
445 last_swapped_software_frame_scale_factor_(1.f), | 445 last_swapped_software_frame_scale_factor_(1.f), |
446 paint_canvas_(NULL), | 446 paint_canvas_(NULL), |
447 synthetic_move_sent_(false), | 447 synthetic_move_sent_(false), |
448 cursor_visibility_state_in_renderer_(UNKNOWN), | 448 cursor_visibility_state_in_renderer_(UNKNOWN), |
449 #if defined(OS_WIN) | 449 #if defined(OS_WIN) |
450 legacy_render_widget_host_HWND_(NULL), | 450 legacy_render_widget_host_HWND_(NULL), |
451 legacy_window_destroyed_(false), | |
452 #endif | 451 #endif |
453 touch_editing_client_(NULL), | 452 touch_editing_client_(NULL), |
454 weak_ptr_factory_(this) { | 453 weak_ptr_factory_(this) { |
455 host_->SetView(this); | 454 host_->SetView(this); |
456 window_observer_.reset(new WindowObserver(this)); | 455 window_observer_.reset(new WindowObserver(this)); |
457 aura::client::SetTooltipText(window_, &tooltip_); | 456 aura::client::SetTooltipText(window_, &tooltip_); |
458 aura::client::SetActivationDelegate(window_, this); | 457 aura::client::SetActivationDelegate(window_, this); |
459 aura::client::SetActivationChangeObserver(window_, this); | 458 aura::client::SetActivationChangeObserver(window_, this); |
460 aura::client::SetFocusChangeObserver(window_, this); | 459 aura::client::SetFocusChangeObserver(window_, this); |
461 window_->set_layer_owner_delegate(delegated_frame_host_.get()); | 460 window_->set_layer_owner_delegate(delegated_frame_host_.get()); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 if (root) { | 563 if (root) { |
565 aura::client::CursorClient* cursor_client = | 564 aura::client::CursorClient* cursor_client = |
566 aura::client::GetCursorClient(root); | 565 aura::client::GetCursorClient(root); |
567 if (cursor_client) | 566 if (cursor_client) |
568 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); | 567 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); |
569 } | 568 } |
570 | 569 |
571 delegated_frame_host_->WasShown(); | 570 delegated_frame_host_->WasShown(); |
572 | 571 |
573 #if defined(OS_WIN) | 572 #if defined(OS_WIN) |
574 if (legacy_render_widget_host_HWND_) { | |
575 // Reparent the legacy Chrome_RenderWidgetHostHWND window to the parent | |
576 // window before reparenting any plugins. This ensures that the plugin | |
577 // windows stay on top of the child Zorder in the parent and receive | |
578 // mouse events, etc. | |
579 legacy_render_widget_host_HWND_->UpdateParent( | |
580 GetNativeView()->GetHost()->GetAcceleratedWidget()); | |
581 legacy_render_widget_host_HWND_->SetBounds( | |
582 window_->GetBoundsInRootWindow()); | |
583 } | |
584 LPARAM lparam = reinterpret_cast<LPARAM>(this); | 573 LPARAM lparam = reinterpret_cast<LPARAM>(this); |
585 EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam); | 574 EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam); |
586 #endif | 575 #endif |
587 } | 576 } |
588 | 577 |
589 void RenderWidgetHostViewAura::WasHidden() { | 578 void RenderWidgetHostViewAura::WasHidden() { |
590 if (!host_ || host_->is_hidden()) | 579 if (!host_ || host_->is_hidden()) |
591 return; | 580 return; |
592 host_->WasHidden(); | 581 host_->WasHidden(); |
593 delegated_frame_host_->WasHidden(); | 582 delegated_frame_host_->WasHidden(); |
594 | 583 |
595 #if defined(OS_WIN) | 584 #if defined(OS_WIN) |
596 constrained_rects_.clear(); | 585 constrained_rects_.clear(); |
597 aura::WindowTreeHost* host = window_->GetHost(); | 586 aura::WindowTreeHost* host = window_->GetHost(); |
598 if (host) { | 587 if (host) { |
599 HWND parent = host->GetAcceleratedWidget(); | 588 HWND parent = host->GetAcceleratedWidget(); |
600 LPARAM lparam = reinterpret_cast<LPARAM>(this); | 589 LPARAM lparam = reinterpret_cast<LPARAM>(this); |
601 EnumChildWindows(parent, HideWindowsCallback, lparam); | 590 EnumChildWindows(parent, HideWindowsCallback, lparam); |
602 // We reparent the legacy Chrome_RenderWidgetHostHWND window to the global | |
603 // hidden window on the same lines as Windowed plugin windows. | |
604 if (legacy_render_widget_host_HWND_) | |
605 legacy_render_widget_host_HWND_->UpdateParent(ui::GetHiddenWindow()); | |
606 } | 591 } |
607 #endif | 592 #endif |
608 } | 593 } |
609 | 594 |
610 void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { | 595 void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { |
611 // For a SetSize operation, we don't care what coordinate system the origin | 596 // For a SetSize operation, we don't care what coordinate system the origin |
612 // of the window is in, it's only important to make sure that the origin | 597 // of the window is in, it's only important to make sure that the origin |
613 // remains constant after the operation. | 598 // remains constant after the operation. |
614 InternalSetBounds(gfx::Rect(window_->bounds().origin(), size)); | 599 InternalSetBounds(gfx::Rect(window_->bounds().origin(), size)); |
615 } | 600 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 return window_->HasFocus(); | 741 return window_->HasFocus(); |
757 } | 742 } |
758 | 743 |
759 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const { | 744 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const { |
760 return delegated_frame_host_->CanCopyToBitmap(); | 745 return delegated_frame_host_->CanCopyToBitmap(); |
761 } | 746 } |
762 | 747 |
763 void RenderWidgetHostViewAura::Show() { | 748 void RenderWidgetHostViewAura::Show() { |
764 window_->Show(); | 749 window_->Show(); |
765 WasShown(); | 750 WasShown(); |
766 #if defined(OS_WIN) | |
767 if (legacy_render_widget_host_HWND_) | |
768 legacy_render_widget_host_HWND_->Show(); | |
769 #endif | |
770 } | 751 } |
771 | 752 |
772 void RenderWidgetHostViewAura::Hide() { | 753 void RenderWidgetHostViewAura::Hide() { |
773 window_->Hide(); | 754 window_->Hide(); |
774 WasHidden(); | 755 WasHidden(); |
775 #if defined(OS_WIN) | |
776 if (legacy_render_widget_host_HWND_) | |
777 legacy_render_widget_host_HWND_->Hide(); | |
778 #endif | |
779 } | 756 } |
780 | 757 |
781 bool RenderWidgetHostViewAura::IsShowing() { | 758 bool RenderWidgetHostViewAura::IsShowing() { |
782 return window_->IsVisible(); | 759 return window_->IsVisible(); |
783 } | 760 } |
784 | 761 |
785 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { | 762 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { |
786 return window_->GetBoundsInScreen(); | 763 return window_->GetBoundsInScreen(); |
787 } | 764 } |
788 | 765 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 EnumChildWindows(parent, SetCutoutRectsCallback, lparam); | 974 EnumChildWindows(parent, SetCutoutRectsCallback, lparam); |
998 } | 975 } |
999 | 976 |
1000 void RenderWidgetHostViewAura::UpdateMouseLockRegion() { | 977 void RenderWidgetHostViewAura::UpdateMouseLockRegion() { |
1001 // Clip the cursor if chrome is running on regular desktop. | 978 // Clip the cursor if chrome is running on regular desktop. |
1002 if (gfx::Screen::GetScreenFor(window_) == gfx::Screen::GetNativeScreen()) { | 979 if (gfx::Screen::GetScreenFor(window_) == gfx::Screen::GetNativeScreen()) { |
1003 RECT window_rect = window_->GetBoundsInScreen().ToRECT(); | 980 RECT window_rect = window_->GetBoundsInScreen().ToRECT(); |
1004 ::ClipCursor(&window_rect); | 981 ::ClipCursor(&window_rect); |
1005 } | 982 } |
1006 } | 983 } |
1007 | 984 #endif // defined(OS_WIN) |
1008 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { | |
1009 legacy_render_widget_host_HWND_ = NULL; | |
1010 legacy_window_destroyed_ = true; | |
1011 } | |
1012 #endif | |
1013 | 985 |
1014 void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( | 986 void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( |
1015 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, | 987 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, |
1016 int gpu_host_id) { | 988 int gpu_host_id) { |
1017 // Oldschool composited mode is no longer supported. | 989 // Oldschool composited mode is no longer supported. |
1018 } | 990 } |
1019 | 991 |
1020 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 992 void RenderWidgetHostViewAura::OnSwapCompositorFrame( |
1021 uint32 output_surface_id, | 993 uint32 output_surface_id, |
1022 scoped_ptr<cc::CompositorFrame> frame) { | 994 scoped_ptr<cc::CompositorFrame> frame) { |
(...skipping 10 matching lines...) Expand all Loading... |
1033 if (frame->software_frame_data) { | 1005 if (frame->software_frame_data) { |
1034 DLOG(ERROR) << "Unable to use software frame in aura"; | 1006 DLOG(ERROR) << "Unable to use software frame in aura"; |
1035 RecordAction( | 1007 RecordAction( |
1036 base::UserMetricsAction("BadMessageTerminate_SharedMemoryAura")); | 1008 base::UserMetricsAction("BadMessageTerminate_SharedMemoryAura")); |
1037 host_->GetProcess()->ReceivedBadMessage(); | 1009 host_->GetProcess()->ReceivedBadMessage(); |
1038 return; | 1010 return; |
1039 } | 1011 } |
1040 } | 1012 } |
1041 | 1013 |
1042 #if defined(OS_WIN) | 1014 #if defined(OS_WIN) |
| 1015 void RenderWidgetHostViewAura::SetLegacyRenderWidgetHostHWND( |
| 1016 LegacyRenderWidgetHostHWND* legacy_hwnd) { |
| 1017 legacy_render_widget_host_HWND_ = legacy_hwnd; |
| 1018 } |
| 1019 |
1043 void RenderWidgetHostViewAura::SetParentNativeViewAccessible( | 1020 void RenderWidgetHostViewAura::SetParentNativeViewAccessible( |
1044 gfx::NativeViewAccessible accessible_parent) { | 1021 gfx::NativeViewAccessible accessible_parent) { |
1045 } | 1022 } |
1046 | 1023 |
1047 gfx::NativeViewId RenderWidgetHostViewAura::GetParentForWindowlessPlugin() | 1024 gfx::NativeViewId RenderWidgetHostViewAura::GetParentForWindowlessPlugin() |
1048 const { | 1025 const { |
1049 if (legacy_render_widget_host_HWND_) { | 1026 if (legacy_render_widget_host_HWND_) { |
1050 return reinterpret_cast<gfx::NativeViewId>( | 1027 return reinterpret_cast<gfx::NativeViewId>( |
1051 legacy_render_widget_host_HWND_->hwnd()); | 1028 legacy_render_widget_host_HWND_->hwnd()); |
1052 } | 1029 } |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 HWND parent = NULL; | 1614 HWND parent = NULL; |
1638 // If the tab was hidden and it's closed, host_->is_hidden would have been | 1615 // If the tab was hidden and it's closed, host_->is_hidden would have been |
1639 // reset to false in RenderWidgetHostImpl::RendererExited. | 1616 // reset to false in RenderWidgetHostImpl::RendererExited. |
1640 if (!window_->GetRootWindow() || host_->is_hidden()) { | 1617 if (!window_->GetRootWindow() || host_->is_hidden()) { |
1641 parent = ui::GetHiddenWindow(); | 1618 parent = ui::GetHiddenWindow(); |
1642 } else { | 1619 } else { |
1643 parent = window_->GetHost()->GetAcceleratedWidget(); | 1620 parent = window_->GetHost()->GetAcceleratedWidget(); |
1644 } | 1621 } |
1645 LPARAM lparam = reinterpret_cast<LPARAM>(this); | 1622 LPARAM lparam = reinterpret_cast<LPARAM>(this); |
1646 EnumChildWindows(parent, WindowDestroyingCallback, lparam); | 1623 EnumChildWindows(parent, WindowDestroyingCallback, lparam); |
1647 | 1624 legacy_render_widget_host_HWND_ = NULL; |
1648 // The LegacyRenderWidgetHostHWND instance is destroyed when its window is | |
1649 // destroyed. Normally we control when that happens via the Destroy call | |
1650 // in the dtor. However there may be cases where the window is destroyed | |
1651 // by Windows, i.e. the parent window is destroyed before the | |
1652 // RenderWidgetHostViewAura instance goes away etc. To avoid that we | |
1653 // destroy the LegacyRenderWidgetHostHWND instance here. | |
1654 if (legacy_render_widget_host_HWND_) { | |
1655 legacy_render_widget_host_HWND_->set_host(NULL); | |
1656 legacy_render_widget_host_HWND_->Destroy(); | |
1657 // The Destroy call above will delete the LegacyRenderWidgetHostHWND | |
1658 // instance. | |
1659 legacy_render_widget_host_HWND_ = NULL; | |
1660 } | |
1661 #endif | 1625 #endif |
1662 | 1626 |
1663 // Make sure that the input method no longer references to this object before | 1627 // Make sure that the input method no longer references to this object before |
1664 // this object is removed from the root window (i.e. this object loses access | 1628 // this object is removed from the root window (i.e. this object loses access |
1665 // to the input method). | 1629 // to the input method). |
1666 ui::InputMethod* input_method = GetInputMethod(); | 1630 ui::InputMethod* input_method = GetInputMethod(); |
1667 if (input_method) | 1631 if (input_method) |
1668 input_method->DetachTextInputClient(this); | 1632 input_method->DetachTextInputClient(this); |
1669 | 1633 |
1670 if (overscroll_controller_) | 1634 if (overscroll_controller_) |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2140 popup_child_host_view_->popup_parent_host_view_ = NULL; | 2104 popup_child_host_view_->popup_parent_host_view_ = NULL; |
2141 } | 2105 } |
2142 event_filter_for_popup_exit_.reset(); | 2106 event_filter_for_popup_exit_.reset(); |
2143 aura::client::SetTooltipText(window_, NULL); | 2107 aura::client::SetTooltipText(window_, NULL); |
2144 gfx::Screen::GetScreenFor(window_)->RemoveObserver(this); | 2108 gfx::Screen::GetScreenFor(window_)->RemoveObserver(this); |
2145 | 2109 |
2146 // This call is usually no-op since |this| object is already removed from the | 2110 // This call is usually no-op since |this| object is already removed from the |
2147 // Aura root window and we don't have a way to get an input method object | 2111 // Aura root window and we don't have a way to get an input method object |
2148 // associated with the window, but just in case. | 2112 // associated with the window, but just in case. |
2149 DetachFromInputMethod(); | 2113 DetachFromInputMethod(); |
2150 | |
2151 #if defined(OS_WIN) | |
2152 // The LegacyRenderWidgetHostHWND window should have been destroyed in | |
2153 // RenderWidgetHostViewAura::OnWindowDestroying and the pointer should | |
2154 // be set to NULL. | |
2155 DCHECK(!legacy_render_widget_host_HWND_); | |
2156 #endif | |
2157 } | 2114 } |
2158 | 2115 |
2159 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { | 2116 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { |
2160 const gfx::Point screen_point = | 2117 const gfx::Point screen_point = |
2161 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); | 2118 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); |
2162 aura::Window* root_window = window_->GetRootWindow(); | 2119 aura::Window* root_window = window_->GetRootWindow(); |
2163 if (!root_window) | 2120 if (!root_window) |
2164 return; | 2121 return; |
2165 | 2122 |
2166 gfx::Point root_window_point = screen_point; | 2123 gfx::Point root_window_point = screen_point; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2287 // a Window::SetBoundsInternal call. | 2244 // a Window::SetBoundsInternal call. |
2288 if (!in_bounds_changed_) | 2245 if (!in_bounds_changed_) |
2289 window_->SetBounds(rect); | 2246 window_->SetBounds(rect); |
2290 host_->WasResized(); | 2247 host_->WasResized(); |
2291 delegated_frame_host_->WasResized(); | 2248 delegated_frame_host_->WasResized(); |
2292 if (touch_editing_client_) { | 2249 if (touch_editing_client_) { |
2293 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, | 2250 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, |
2294 selection_focus_rect_); | 2251 selection_focus_rect_); |
2295 } | 2252 } |
2296 #if defined(OS_WIN) | 2253 #if defined(OS_WIN) |
2297 // Create the legacy dummy window which corresponds to the bounds of the | |
2298 // webcontents. This will be passed as the container window for windowless | |
2299 // plugins. | |
2300 // Plugins like Flash assume the container window which is returned via the | |
2301 // NPNVnetscapeWindow property corresponds to the bounds of the webpage. | |
2302 // This is not true in Aura where we have only HWND which is the main Aura | |
2303 // window. If we return this window to plugins like Flash then it causes the | |
2304 // coordinate translations done by these plugins to break. | |
2305 // Additonally the legacy dummy window is needed for accessibility and for | |
2306 // scrolling to work in legacy drivers for trackpoints/trackpads, etc. | |
2307 if (!legacy_window_destroyed_ && GetNativeViewId()) { | |
2308 if (!legacy_render_widget_host_HWND_) { | |
2309 legacy_render_widget_host_HWND_ = LegacyRenderWidgetHostHWND::Create( | |
2310 reinterpret_cast<HWND>(GetNativeViewId())); | |
2311 } | |
2312 if (legacy_render_widget_host_HWND_) { | |
2313 legacy_render_widget_host_HWND_->set_host(this); | |
2314 legacy_render_widget_host_HWND_->SetBounds( | |
2315 window_->GetBoundsInRootWindow()); | |
2316 // There are cases where the parent window is created, made visible and | |
2317 // the associated RenderWidget is also visible before the | |
2318 // LegacyRenderWidgetHostHWND instace is created. Ensure that it is shown | |
2319 // here. | |
2320 if (!host_->is_hidden()) | |
2321 legacy_render_widget_host_HWND_->Show(); | |
2322 } | |
2323 } | |
2324 | |
2325 if (mouse_locked_) | 2254 if (mouse_locked_) |
2326 UpdateMouseLockRegion(); | 2255 UpdateMouseLockRegion(); |
2327 #endif | 2256 #endif |
2328 } | 2257 } |
2329 | 2258 |
2330 void RenderWidgetHostViewAura::SchedulePaintIfNotInClip( | 2259 void RenderWidgetHostViewAura::SchedulePaintIfNotInClip( |
2331 const gfx::Rect& rect, | 2260 const gfx::Rect& rect, |
2332 const gfx::Rect& clip) { | 2261 const gfx::Rect& clip) { |
2333 if (!clip.IsEmpty()) { | 2262 if (!clip.IsEmpty()) { |
2334 gfx::Rect to_paint = gfx::SubtractRects(rect, clip); | 2263 gfx::Rect to_paint = gfx::SubtractRects(rect, clip); |
(...skipping 25 matching lines...) Expand all Loading... |
2360 if (cursor_client) { | 2289 if (cursor_client) { |
2361 cursor_client->AddObserver(this); | 2290 cursor_client->AddObserver(this); |
2362 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); | 2291 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); |
2363 } | 2292 } |
2364 if (HasFocus()) { | 2293 if (HasFocus()) { |
2365 ui::InputMethod* input_method = GetInputMethod(); | 2294 ui::InputMethod* input_method = GetInputMethod(); |
2366 if (input_method) | 2295 if (input_method) |
2367 input_method->SetFocusedTextInputClient(this); | 2296 input_method->SetFocusedTextInputClient(this); |
2368 } | 2297 } |
2369 | 2298 |
2370 #if defined(OS_WIN) | |
2371 // The parent may have changed here. Ensure that the legacy window is | |
2372 // reparented accordingly. | |
2373 if (legacy_render_widget_host_HWND_) | |
2374 legacy_render_widget_host_HWND_->UpdateParent( | |
2375 reinterpret_cast<HWND>(GetNativeViewId())); | |
2376 #endif | |
2377 | |
2378 delegated_frame_host_->AddedToWindow(); | 2299 delegated_frame_host_->AddedToWindow(); |
2379 } | 2300 } |
2380 | 2301 |
2381 void RenderWidgetHostViewAura::RemovingFromRootWindow() { | 2302 void RenderWidgetHostViewAura::RemovingFromRootWindow() { |
2382 aura::client::CursorClient* cursor_client = | 2303 aura::client::CursorClient* cursor_client = |
2383 aura::client::GetCursorClient(window_->GetRootWindow()); | 2304 aura::client::GetCursorClient(window_->GetRootWindow()); |
2384 if (cursor_client) | 2305 if (cursor_client) |
2385 cursor_client->RemoveObserver(this); | 2306 cursor_client->RemoveObserver(this); |
2386 | 2307 |
2387 DetachFromInputMethod(); | 2308 DetachFromInputMethod(); |
2388 | 2309 |
2389 window_->GetHost()->RemoveObserver(this); | 2310 window_->GetHost()->RemoveObserver(this); |
2390 delegated_frame_host_->RemovingFromWindow(); | 2311 delegated_frame_host_->RemovingFromWindow(); |
2391 | |
2392 #if defined(OS_WIN) | |
2393 // Update the legacy window's parent temporarily to the desktop window. It | |
2394 // will eventually get reparented to the right root. | |
2395 if (legacy_render_widget_host_HWND_) | |
2396 legacy_render_widget_host_HWND_->UpdateParent(::GetDesktopWindow()); | |
2397 #endif | |
2398 } | 2312 } |
2399 | 2313 |
2400 void RenderWidgetHostViewAura::DetachFromInputMethod() { | 2314 void RenderWidgetHostViewAura::DetachFromInputMethod() { |
2401 ui::InputMethod* input_method = GetInputMethod(); | 2315 ui::InputMethod* input_method = GetInputMethod(); |
2402 if (input_method && input_method->GetTextInputClient() == this) | 2316 if (input_method && input_method->GetTextInputClient() == this) |
2403 input_method->SetFocusedTextInputClient(NULL); | 2317 input_method->SetFocusedTextInputClient(NULL); |
2404 } | 2318 } |
2405 | 2319 |
2406 void RenderWidgetHostViewAura::ForwardKeyboardEvent( | 2320 void RenderWidgetHostViewAura::ForwardKeyboardEvent( |
2407 const NativeWebKeyboardEvent& event) { | 2321 const NativeWebKeyboardEvent& event) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 | 2404 |
2491 //////////////////////////////////////////////////////////////////////////////// | 2405 //////////////////////////////////////////////////////////////////////////////// |
2492 // RenderWidgetHostViewBase, public: | 2406 // RenderWidgetHostViewBase, public: |
2493 | 2407 |
2494 // static | 2408 // static |
2495 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2409 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2496 GetScreenInfoForWindow(results, NULL); | 2410 GetScreenInfoForWindow(results, NULL); |
2497 } | 2411 } |
2498 | 2412 |
2499 } // namespace content | 2413 } // namespace content |
OLD | NEW |