Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: components/constrained_window/constrained_window_views.cc

Issue 2474783002: Fix memory leak for extension uninstall dialog. (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698