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

Side by Side Diff: views/controls/native/native_view_host_win.cc

Issue 510004: Fix crash/leak issue in native_view_host_gtk.cc. (Closed)
Patch Set: " Created 11 years 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "views/controls/native/native_view_host_win.h" 5 #include "views/controls/native/native_view_host_win.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "views/controls/native/native_view_host.h" 9 #include "views/controls/native/native_view_host.h"
10 #include "views/focus/focus_manager.h" 10 #include "views/focus/focus_manager.h"
(...skipping 21 matching lines...) Expand all
32 32
33 // First hide the new window. We don't want anything to draw (like sub-hwnd 33 // First hide the new window. We don't want anything to draw (like sub-hwnd
34 // borders), when we change the parent below. 34 // borders), when we change the parent below.
35 ShowWindow(host_->native_view(), SW_HIDE); 35 ShowWindow(host_->native_view(), SW_HIDE);
36 36
37 // Need to set the HWND's parent before changing its size to avoid flashing. 37 // Need to set the HWND's parent before changing its size to avoid flashing.
38 SetParent(host_->native_view(), host_->GetWidget()->GetNativeView()); 38 SetParent(host_->native_view(), host_->GetWidget()->GetNativeView());
39 host_->Layout(); 39 host_->Layout();
40 } 40 }
41 41
42 void NativeViewHostWin::NativeViewDetaching() { 42 void NativeViewHostWin::NativeViewDetaching(bool destroyed) {
43 installed_clip_ = false; 43 installed_clip_ = false;
44 } 44 }
45 45
46 void NativeViewHostWin::AddedToWidget() { 46 void NativeViewHostWin::AddedToWidget() {
47 if (!IsWindow(host_->native_view())) 47 if (!IsWindow(host_->native_view()))
48 return; 48 return;
49 HWND parent_hwnd = GetParent(host_->native_view()); 49 HWND parent_hwnd = GetParent(host_->native_view());
50 HWND widget_hwnd = host_->GetWidget()->GetNativeView(); 50 HWND widget_hwnd = host_->GetWidget()->GetNativeView();
51 if (parent_hwnd != widget_hwnd) 51 if (parent_hwnd != widget_hwnd)
52 SetParent(host_->native_view(), widget_hwnd); 52 SetParent(host_->native_view(), widget_hwnd);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 //////////////////////////////////////////////////////////////////////////////// 123 ////////////////////////////////////////////////////////////////////////////////
124 // NativeViewHostWrapper, public: 124 // NativeViewHostWrapper, public:
125 125
126 // static 126 // static
127 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( 127 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper(
128 NativeViewHost* host) { 128 NativeViewHost* host) {
129 return new NativeViewHostWin(host); 129 return new NativeViewHostWin(host);
130 } 130 }
131 131
132 } // namespace views 132 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/native/native_view_host_win.h ('k') | views/controls/native/native_view_host_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698