OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |