Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: content/browser/renderer_host/legacy_render_widget_host_win.cc

Issue 2040333002: Merge to M52: Fix a bug with the Chrome legacy window at times becoming a top level window with a n… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698