| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 focus_manager_.reset(FocusManagerFactory::Create(this, desktop_widget)); | 1061 focus_manager_.reset(FocusManagerFactory::Create(this, desktop_widget)); |
| 1062 | 1062 |
| 1063 native_widget_->InitModalType(widget_delegate_->GetModalType()); | 1063 native_widget_->InitModalType(widget_delegate_->GetModalType()); |
| 1064 | 1064 |
| 1065 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetCreated(this)); | 1065 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetCreated(this)); |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 void Widget::OnNativeWidgetDestroying() { | 1068 void Widget::OnNativeWidgetDestroying() { |
| 1069 // Tell the focus manager (if any) that root_view is being removed | 1069 // Tell the focus manager (if any) that root_view is being removed |
| 1070 // in case that the focused view is under this root view. | 1070 // in case that the focused view is under this root view. |
| 1071 if (GetFocusManager()) | 1071 if (GetFocusManager() && root_view_) |
| 1072 GetFocusManager()->ViewRemoved(root_view_.get()); | 1072 GetFocusManager()->ViewRemoved(root_view_.get()); |
| 1073 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetDestroying(this)); | 1073 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetDestroying(this)); |
| 1074 if (non_client_view_) | 1074 if (non_client_view_) |
| 1075 non_client_view_->WindowClosing(); | 1075 non_client_view_->WindowClosing(); |
| 1076 widget_delegate_->WindowClosing(); | 1076 widget_delegate_->WindowClosing(); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 void Widget::OnNativeWidgetDestroyed() { | 1079 void Widget::OnNativeWidgetDestroyed() { |
| 1080 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetDestroyed(this)); | 1080 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetDestroyed(this)); |
| 1081 widget_delegate_->DeleteDelegate(); | 1081 widget_delegate_->DeleteDelegate(); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 | 1487 |
| 1488 //////////////////////////////////////////////////////////////////////////////// | 1488 //////////////////////////////////////////////////////////////////////////////// |
| 1489 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1489 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1490 | 1490 |
| 1491 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1491 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1492 return this; | 1492 return this; |
| 1493 } | 1493 } |
| 1494 | 1494 |
| 1495 } // namespace internal | 1495 } // namespace internal |
| 1496 } // namespace views | 1496 } // namespace views |
| OLD | NEW |