| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/legacy_render_widget_host_win.h" | 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 void LegacyRenderWidgetHostHWND::Destroy() { | 56 void LegacyRenderWidgetHostHWND::Destroy() { |
| 57 if (::IsWindow(hwnd())) | 57 if (::IsWindow(hwnd())) |
| 58 ::DestroyWindow(hwnd()); | 58 ::DestroyWindow(hwnd()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void LegacyRenderWidgetHostHWND::UpdateParent(HWND parent) { | 61 void LegacyRenderWidgetHostHWND::UpdateParent(HWND parent) { |
| 62 if (GetWindowEventTarget(GetParent())) | 62 if (GetWindowEventTarget(GetParent())) |
| 63 GetWindowEventTarget(GetParent())->HandleParentChanged(); | 63 GetWindowEventTarget(GetParent())->HandleParentChanged(); |
| 64 ::SetParent(hwnd(), parent); | 64 ::SetParent(hwnd(), parent); |
| 65 // If the new parent is the desktop Window, then we disable the child window | |
| 66 // to ensure that it does not receive any input events. It should not because | |
| 67 // of WS_EX_TRANSPARENT. This is only for safety. | |
| 68 if (parent == ::GetDesktopWindow()) { | |
| 69 ::EnableWindow(hwnd(), FALSE); | |
| 70 } else { | |
| 71 ::EnableWindow(hwnd(), TRUE); | |
| 72 } | |
| 73 } | 65 } |
| 74 | 66 |
| 75 HWND LegacyRenderWidgetHostHWND::GetParent() { | 67 HWND LegacyRenderWidgetHostHWND::GetParent() { |
| 76 return ::GetParent(hwnd()); | 68 return ::GetParent(hwnd()); |
| 77 } | 69 } |
| 78 | 70 |
| 79 void LegacyRenderWidgetHostHWND::Show() { | 71 void LegacyRenderWidgetHostHWND::Show() { |
| 80 ::ShowWindow(hwnd(), SW_SHOW); | 72 ::ShowWindow(hwnd(), SW_SHOW); |
| 81 } | 73 } |
| 82 | 74 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 direct_manipulation_helper_->Activate(hwnd()); | 406 direct_manipulation_helper_->Activate(hwnd()); |
| 415 } else if (window_pos->flags & SWP_HIDEWINDOW) { | 407 } else if (window_pos->flags & SWP_HIDEWINDOW) { |
| 416 direct_manipulation_helper_->Deactivate(hwnd()); | 408 direct_manipulation_helper_->Deactivate(hwnd()); |
| 417 } | 409 } |
| 418 } | 410 } |
| 419 SetMsgHandled(FALSE); | 411 SetMsgHandled(FALSE); |
| 420 return 0; | 412 return 0; |
| 421 } | 413 } |
| 422 | 414 |
| 423 } // namespace content | 415 } // namespace content |
| OLD | NEW |