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...) 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_, nullptr); | 59 target_widget_->SetNativeWindowProperty(native_window_property_, nullptr); |
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_ = nullptr; | 72 host_ = nullptr; |
73 } | 73 } |
(...skipping 152 matching lines...) Loading... |
226 DCHECK_EQ(parent_view, host->GetHostView()); | 226 DCHECK_EQ(parent_view, host->GetHostView()); |
227 ModalDialogHostObserver* dialog_host_observer = | 227 ModalDialogHostObserver* dialog_host_observer = |
228 new WidgetModalDialogHostObserverViews( | 228 new WidgetModalDialogHostObserverViews( |
229 host, widget, kWidgetModalDialogHostObserverViewsKey); | 229 host, widget, kWidgetModalDialogHostObserverViewsKey); |
230 dialog_host_observer->OnPositionRequiresUpdate(); | 230 dialog_host_observer->OnPositionRequiresUpdate(); |
231 } | 231 } |
232 return widget; | 232 return widget; |
233 } | 233 } |
234 | 234 |
235 } // namespace constrained window | 235 } // namespace constrained window |
OLD | NEW |