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

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

Issue 8774029: Delete desktop/shell instance correctly when chrome is shutting down (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: close windows before observers are destroyed. Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura_shell/test/aura_shell_test_base.cc ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/drag_drop_client.h" 10 #include "ui/aura/client/drag_drop_client.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 void NativeWidgetAura::SetShape(gfx::NativeRegion region) { 365 void NativeWidgetAura::SetShape(gfx::NativeRegion region) {
366 // No need for this. 366 // No need for this.
367 } 367 }
368 368
369 void NativeWidgetAura::Close() { 369 void NativeWidgetAura::Close() {
370 // |window_| may already be deleted by parent window. This can happen 370 // |window_| may already be deleted by parent window. This can happen
371 // when this widget is child widget or has transient parent 371 // when this widget is child widget or has transient parent
372 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. 372 // and ownership is WIDGET_OWNS_NATIVE_WIDGET.
373 DCHECK(window_ || 373 DCHECK(window_ ||
374 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); 374 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET);
375 if (window_) 375 if (window_) {
376 Hide(); 376 Hide();
377 377 window_->SetIntProperty(aura::kModalKey, 0);
378 window_->SetIntProperty(aura::kModalKey, 0); 378 }
379 379
380 if (!close_widget_factory_.HasWeakPtrs()) { 380 if (!close_widget_factory_.HasWeakPtrs()) {
381 MessageLoop::current()->PostTask( 381 MessageLoop::current()->PostTask(
382 FROM_HERE, 382 FROM_HERE,
383 base::Bind(&NativeWidgetAura::CloseNow, 383 base::Bind(&NativeWidgetAura::CloseNow,
384 close_widget_factory_.GetWeakPtr())); 384 close_widget_factory_.GetWeakPtr()));
385 } 385 }
386 } 386 }
387 387
388 void NativeWidgetAura::CloseNow() { 388 void NativeWidgetAura::CloseNow() {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 NOTIMPLEMENTED(); 764 NOTIMPLEMENTED();
765 } 765 }
766 766
767 // static 767 // static
768 bool NativeWidgetPrivate::IsMouseButtonDown() { 768 bool NativeWidgetPrivate::IsMouseButtonDown() {
769 return aura::Desktop::GetInstance()->IsMouseButtonDown(); 769 return aura::Desktop::GetInstance()->IsMouseButtonDown();
770 } 770 }
771 771
772 } // namespace internal 772 } // namespace internal
773 } // namespace views 773 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura_shell/test/aura_shell_test_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698