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

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

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
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 "components/constrained_window/constrained_window_views_client.h" 9 #include "components/constrained_window/constrained_window_views_client.h"
10 #include "components/web_modal/popup_manager.h" 10 #include "components/web_modal/popup_manager.h"
(...skipping 25 matching lines...) Expand all
36 const char *const native_window_property) 36 const char *const native_window_property)
37 : host_(host), 37 : host_(host),
38 target_widget_(target_widget), 38 target_widget_(target_widget),
39 native_window_property_(native_window_property) { 39 native_window_property_(native_window_property) {
40 DCHECK(host_); 40 DCHECK(host_);
41 DCHECK(target_widget_); 41 DCHECK(target_widget_);
42 host_->AddObserver(this); 42 host_->AddObserver(this);
43 target_widget_->AddObserver(this); 43 target_widget_->AddObserver(this);
44 } 44 }
45 45
46 virtual ~WidgetModalDialogHostObserverViews() { 46 ~WidgetModalDialogHostObserverViews() override {
47 if (host_) 47 if (host_)
48 host_->RemoveObserver(this); 48 host_->RemoveObserver(this);
49 target_widget_->RemoveObserver(this); 49 target_widget_->RemoveObserver(this);
50 target_widget_->SetNativeWindowProperty(native_window_property_, NULL); 50 target_widget_->SetNativeWindowProperty(native_window_property_, NULL);
51 } 51 }
52 52
53 // WidgetObserver overrides 53 // WidgetObserver overrides
54 virtual void OnWidgetClosing(views::Widget* widget) override { 54 void OnWidgetClosing(views::Widget* widget) override { delete this; }
55 delete this;
56 }
57 55
58 // WebContentsModalDialogHostObserver overrides 56 // WebContentsModalDialogHostObserver overrides
59 virtual void OnPositionRequiresUpdate() override { 57 void OnPositionRequiresUpdate() override {
60 UpdateWidgetModalDialogPosition(target_widget_, host_); 58 UpdateWidgetModalDialogPosition(target_widget_, host_);
61 } 59 }
62 60
63 virtual void OnHostDestroying() override { 61 void OnHostDestroying() override {
64 host_->RemoveObserver(this); 62 host_->RemoveObserver(this);
65 host_ = NULL; 63 host_ = NULL;
66 } 64 }
67 65
68 private: 66 private:
69 ModalDialogHost* host_; 67 ModalDialogHost* host_;
70 views::Widget* target_widget_; 68 views::Widget* target_widget_;
71 const char* const native_window_property_; 69 const char* const native_window_property_;
72 70
73 DISALLOW_COPY_AND_ASSIGN(WidgetModalDialogHostObserverViews); 71 DISALLOW_COPY_AND_ASSIGN(WidgetModalDialogHostObserverViews);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 GetModalDialogHost(parent); 163 GetModalDialogHost(parent);
166 if (host) { 164 if (host) {
167 DCHECK_EQ(parent, host->GetHostView()); 165 DCHECK_EQ(parent, host->GetHostView());
168 ModalDialogHostObserver* dialog_host_observer = 166 ModalDialogHostObserver* dialog_host_observer =
169 new WidgetModalDialogHostObserverViews( 167 new WidgetModalDialogHostObserverViews(
170 host, widget, kWidgetModalDialogHostObserverViewsKey); 168 host, widget, kWidgetModalDialogHostObserverViewsKey);
171 dialog_host_observer->OnPositionRequiresUpdate(); 169 dialog_host_observer->OnPositionRequiresUpdate();
172 } 170 }
173 return widget; 171 return widget;
174 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698