| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 bool Widget::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { | 360 bool Widget::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { |
| 361 return false; | 361 return false; |
| 362 } | 362 } |
| 363 | 363 |
| 364 void Widget::ViewHierarchyChanged(bool is_add, View* parent, View* child) { | 364 void Widget::ViewHierarchyChanged(bool is_add, View* parent, View* child) { |
| 365 if (!is_add) { | 365 if (!is_add) { |
| 366 if (child == dragged_view_) | 366 if (child == dragged_view_) |
| 367 dragged_view_ = NULL; | 367 dragged_view_ = NULL; |
| 368 | |
| 369 FocusManager* focus_manager = GetFocusManager(); | 368 FocusManager* focus_manager = GetFocusManager(); |
| 370 if (focus_manager) | 369 if (focus_manager) |
| 371 focus_manager->ViewRemoved(child); | 370 focus_manager->ViewRemoved(child); |
| 372 ViewStorage::GetInstance()->ViewRemoved(child); | 371 ViewStorage::GetInstance()->ViewRemoved(child); |
| 373 native_widget_->ViewRemoved(child); | 372 native_widget_->ViewRemoved(child); |
| 374 } | 373 } |
| 375 } | 374 } |
| 376 | 375 |
| 377 void Widget::NotifyNativeViewHierarchyChanged(bool attached, | 376 void Widget::NotifyNativeViewHierarchyChanged(bool attached, |
| 378 gfx::NativeView native_view) { | 377 gfx::NativeView native_view) { |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 native_widget_->SetAccessibleRole( | 887 native_widget_->SetAccessibleRole( |
| 889 widget_delegate_->GetAccessibleWindowRole()); | 888 widget_delegate_->GetAccessibleWindowRole()); |
| 890 native_widget_->SetAccessibleState( | 889 native_widget_->SetAccessibleState( |
| 891 widget_delegate_->GetAccessibleWindowState()); | 890 widget_delegate_->GetAccessibleWindowState()); |
| 892 | 891 |
| 893 if (widget_delegate_->IsModal()) | 892 if (widget_delegate_->IsModal()) |
| 894 native_widget_->BecomeModal(); | 893 native_widget_->BecomeModal(); |
| 895 } | 894 } |
| 896 | 895 |
| 897 void Widget::OnNativeWidgetDestroying() { | 896 void Widget::OnNativeWidgetDestroying() { |
| 897 // Tell the focus manager (if any) that root_view is being removed |
| 898 // in case that the focused view is under this root view. |
| 899 if (GetFocusManager()) |
| 900 GetFocusManager()->ViewRemoved(root_view_.get()); |
| 898 FOR_EACH_OBSERVER(Observer, observers_, OnWidgetClosing(this)); | 901 FOR_EACH_OBSERVER(Observer, observers_, OnWidgetClosing(this)); |
| 899 if (non_client_view_) | 902 if (non_client_view_) |
| 900 non_client_view_->WindowClosing(); | 903 non_client_view_->WindowClosing(); |
| 901 widget_delegate_->WindowClosing(); | 904 widget_delegate_->WindowClosing(); |
| 902 } | 905 } |
| 903 | 906 |
| 904 void Widget::OnNativeWidgetDestroyed() { | 907 void Widget::OnNativeWidgetDestroyed() { |
| 905 widget_delegate_->DeleteDelegate(); | 908 widget_delegate_->DeleteDelegate(); |
| 906 widget_delegate_ = NULL; | 909 widget_delegate_ = NULL; |
| 907 } | 910 } |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 | 1202 |
| 1200 //////////////////////////////////////////////////////////////////////////////// | 1203 //////////////////////////////////////////////////////////////////////////////// |
| 1201 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1204 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1202 | 1205 |
| 1203 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1206 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1204 return this; | 1207 return this; |
| 1205 } | 1208 } |
| 1206 | 1209 |
| 1207 } // namespace internal | 1210 } // namespace internal |
| 1208 } // namespace views | 1211 } // namespace views |
| OLD | NEW |