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

Side by Side Diff: ui/views/widget/desktop_native_widget_helper_aura.cc

Issue 10966026: Fix a crash in DesktopNativeWidgetHelperAura when closing tabs because it was dereferncing a delete… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix crash Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_native_widget_helper_aura.h ('k') | no next file » | 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) 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 "ui/views/widget/desktop_native_widget_helper_aura.h" 5 #include "ui/views/widget/desktop_native_widget_helper_aura.h"
6 6
7 #include "ui/aura/client/dispatcher_client.h" 7 #include "ui/aura/client/dispatcher_client.h"
8 #include "ui/aura/desktop/desktop_activation_client.h" 8 #include "ui/aura/desktop/desktop_activation_client.h"
9 #include "ui/aura/desktop/desktop_cursor_client.h" 9 #include "ui/aura/desktop/desktop_cursor_client.h"
10 #include "ui/aura/desktop/desktop_dispatcher_client.h" 10 #include "ui/aura/desktop/desktop_dispatcher_client.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 widget_->GetWidget())); 165 widget_->GetWidget()));
166 ui::HWNDSubclass::AddFilterToTarget(root_window_->GetAcceleratedWidget(), 166 ui::HWNDSubclass::AddFilterToTarget(root_window_->GetAcceleratedWidget(),
167 hwnd_message_filter_.get()); 167 hwnd_message_filter_.get());
168 #endif 168 #endif
169 } 169 }
170 170
171 aura::RootWindow* DesktopNativeWidgetHelperAura::GetRootWindow() { 171 aura::RootWindow* DesktopNativeWidgetHelperAura::GetRootWindow() {
172 return root_window_.get(); 172 return root_window_.get();
173 } 173 }
174 174
175 void DesktopNativeWidgetHelperAura::OnWindowDestroying(aura::Window* window) {
176 window_->RemoveObserver(this);
177 window_ = NULL;
178 }
179
175 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds( 180 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds(
176 const gfx::Rect& bounds) { 181 const gfx::Rect& bounds) {
177 gfx::Rect out_bounds = bounds; 182 gfx::Rect out_bounds = bounds;
178 if (root_window_.get() && !out_bounds.IsEmpty()) { 183 if (root_window_.get() && !out_bounds.IsEmpty()) {
179 // TODO(scottmg): This avoids the AdjustWindowRect that ash wants to 184 // TODO(scottmg): This avoids the AdjustWindowRect that ash wants to
180 // adjust the top level on Windows. 185 // adjust the top level on Windows.
181 #if !defined(OS_WIN) 186 #if !defined(OS_WIN)
182 root_window_->SetHostBounds(out_bounds); 187 root_window_->SetHostBounds(out_bounds);
183 #endif 188 #endif
184 out_bounds.set_x(0); 189 out_bounds.set_x(0);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 widget_->GetWidget()->Close(); 233 widget_->GetWidget()->Close();
229 } 234 }
230 235
231 void DesktopNativeWidgetHelperAura::OnRootWindowMoved( 236 void DesktopNativeWidgetHelperAura::OnRootWindowMoved(
232 const aura::RootWindow* root, 237 const aura::RootWindow* root,
233 const gfx::Point& new_origin) { 238 const gfx::Point& new_origin) {
234 widget_->GetWidget()->OnNativeWidgetMove(); 239 widget_->GetWidget()->OnNativeWidgetMove();
235 } 240 }
236 241
237 } // namespace views 242 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_native_widget_helper_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698