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/widget.h" | 5 #include "ui/views/widget/widget.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 482 |
483 native_widget_->Close(); | 483 native_widget_->Close(); |
484 widget_closed_ = true; | 484 widget_closed_ = true; |
485 } | 485 } |
486 } | 486 } |
487 | 487 |
488 void Widget::CloseNow() { | 488 void Widget::CloseNow() { |
489 native_widget_->CloseNow(); | 489 native_widget_->CloseNow(); |
490 } | 490 } |
491 | 491 |
492 void Widget::EnableClose(bool enable) { | |
493 if (non_client_view_) | |
494 non_client_view_->EnableClose(enable); | |
495 native_widget_->EnableClose(enable); | |
496 } | |
497 | |
498 void Widget::Show() { | 492 void Widget::Show() { |
499 if (non_client_view_) { | 493 if (non_client_view_) { |
500 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && | 494 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && |
501 !initial_restored_bounds_.IsEmpty()) { | 495 !initial_restored_bounds_.IsEmpty()) { |
502 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); | 496 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); |
503 } else { | 497 } else { |
504 native_widget_->ShowWithWindowState(saved_show_state_); | 498 native_widget_->ShowWithWindowState(saved_show_state_); |
505 } | 499 } |
506 // |saved_show_state_| only applies the first time the window is shown. | 500 // |saved_show_state_| only applies the first time the window is shown. |
507 // If we don't reset the value the window may be shown maximized every time | 501 // If we don't reset the value the window may be shown maximized every time |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 | 1203 |
1210 //////////////////////////////////////////////////////////////////////////////// | 1204 //////////////////////////////////////////////////////////////////////////////// |
1211 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1205 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1212 | 1206 |
1213 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1207 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1214 return this; | 1208 return this; |
1215 } | 1209 } |
1216 | 1210 |
1217 } // namespace internal | 1211 } // namespace internal |
1218 } // namespace views | 1212 } // namespace views |
OLD | NEW |