OLD | NEW |
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/widget.h" | 5 #include "ui/views/widget/widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 native_widget_->ShowWithWindowState(saved_show_state_); | 511 native_widget_->ShowWithWindowState(saved_show_state_); |
512 } | 512 } |
513 // |saved_show_state_| only applies the first time the window is shown. | 513 // |saved_show_state_| only applies the first time the window is shown. |
514 // If we don't reset the value the window may be shown maximized every time | 514 // If we don't reset the value the window may be shown maximized every time |
515 // it is subsequently shown after being hidden. | 515 // it is subsequently shown after being hidden. |
516 saved_show_state_ = ui::SHOW_STATE_NORMAL; | 516 saved_show_state_ = ui::SHOW_STATE_NORMAL; |
517 } else { | 517 } else { |
518 native_widget_->Show(); | 518 native_widget_->Show(); |
519 } | 519 } |
520 | 520 |
521 if (close_on_deactivate_) { | 521 if (CanActivate() && close_on_deactivate_) { |
522 // Set mouse capture on timeout in case this is called from a | 522 // Set mouse capture on timeout in case this is called from a |
523 // mouse pressed handler. | 523 // mouse pressed handler. |
524 MessageLoopForUI::current()->PostTask(FROM_HERE, base::Bind( | 524 MessageLoopForUI::current()->PostTask(FROM_HERE, base::Bind( |
525 &Widget::SetMouseCapture, set_capture_factory_.GetWeakPtr(), | 525 &Widget::SetMouseCapture, set_capture_factory_.GetWeakPtr(), |
526 static_cast<View*>(NULL))); | 526 static_cast<View*>(NULL))); |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 void Widget::Hide() { | 530 void Widget::Hide() { |
531 native_widget_->Hide(); | 531 native_widget_->Hide(); |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 | 1282 |
1283 //////////////////////////////////////////////////////////////////////////////// | 1283 //////////////////////////////////////////////////////////////////////////////// |
1284 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1284 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1285 | 1285 |
1286 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1286 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1287 return this; | 1287 return this; |
1288 } | 1288 } |
1289 | 1289 |
1290 } // namespace internal | 1290 } // namespace internal |
1291 } // namespace views | 1291 } // namespace views |
OLD | NEW |