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 "components/constrained_window/constrained_window_views.h" | 5 #include "components/constrained_window/constrained_window_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 ~WidgetModalDialogHostObserverViews() override { | 55 ~WidgetModalDialogHostObserverViews() override { |
56 if (host_) | 56 if (host_) |
57 host_->RemoveObserver(this); | 57 host_->RemoveObserver(this); |
58 target_widget_->RemoveObserver(this); | 58 target_widget_->RemoveObserver(this); |
59 target_widget_->SetNativeWindowProperty(native_window_property_, NULL); | 59 target_widget_->SetNativeWindowProperty(native_window_property_, NULL); |
60 } | 60 } |
61 | 61 |
62 // WidgetObserver overrides | 62 // WidgetObserver overrides |
63 void OnWidgetClosing(views::Widget* widget) override { delete this; } | 63 void OnWidgetDestroying(views::Widget* widget) override { delete this; } |
64 | 64 |
65 // WebContentsModalDialogHostObserver overrides | 65 // WebContentsModalDialogHostObserver overrides |
66 void OnPositionRequiresUpdate() override { | 66 void OnPositionRequiresUpdate() override { |
67 UpdateWidgetModalDialogPosition(target_widget_, host_); | 67 UpdateWidgetModalDialogPosition(target_widget_, host_); |
68 } | 68 } |
69 | 69 |
70 void OnHostDestroying() override { | 70 void OnHostDestroying() override { |
71 host_->RemoveObserver(this); | 71 host_->RemoveObserver(this); |
72 host_ = NULL; | 72 host_ = NULL; |
73 } | 73 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 DCHECK_EQ(parent_view, host->GetHostView()); | 225 DCHECK_EQ(parent_view, host->GetHostView()); |
226 ModalDialogHostObserver* dialog_host_observer = | 226 ModalDialogHostObserver* dialog_host_observer = |
227 new WidgetModalDialogHostObserverViews( | 227 new WidgetModalDialogHostObserverViews( |
228 host, widget, kWidgetModalDialogHostObserverViewsKey); | 228 host, widget, kWidgetModalDialogHostObserverViewsKey); |
229 dialog_host_observer->OnPositionRequiresUpdate(); | 229 dialog_host_observer->OnPositionRequiresUpdate(); |
230 } | 230 } |
231 return widget; | 231 return widget; |
232 } | 232 } |
233 | 233 |
234 } // namespace constrained window | 234 } // namespace constrained window |
OLD | NEW |