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

Side by Side Diff: ui/views/test/child_modal_window.cc

Issue 11953066: Reland 179231 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DesktopBackgroundView leak Created 7 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/oak/oak_window.cc ('k') | ui/views/widget/widget_delegate.h » ('j') | 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 "ui/views/test/child_modal_window.h" 5 #include "ui/views/test/child_modal_window.h"
6 6
7 #include "base/utf_string_conversions.h" // ASCIIToUTF16 7 #include "base/utf_string_conversions.h" // ASCIIToUTF16
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/background.h" 10 #include "ui/views/background.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 bool ChildModalParent::CanResize() const { 166 bool ChildModalParent::CanResize() const {
167 return false; 167 return false;
168 } 168 }
169 169
170 void ChildModalParent::DeleteDelegate() { 170 void ChildModalParent::DeleteDelegate() {
171 if (child_) { 171 if (child_) {
172 child_->RemoveObserver(this); 172 child_->RemoveObserver(this);
173 child_->Close(); 173 child_->Close();
174 child_ = NULL; 174 child_ = NULL;
175 } 175 }
176
177 delete this;
176 } 178 }
177 179
178 void ChildModalParent::Layout() { 180 void ChildModalParent::Layout() {
179 int running_y = y(); 181 int running_y = y();
180 button_->SetBounds(x(), running_y, width(), kButtonHeight); 182 button_->SetBounds(x(), running_y, width(), kButtonHeight);
181 running_y += kButtonHeight; 183 running_y += kButtonHeight;
182 textfield_->SetBounds(x(), running_y, width(), kTextfieldHeight); 184 textfield_->SetBounds(x(), running_y, width(), kTextfieldHeight);
183 running_y += kTextfieldHeight; 185 running_y += kTextfieldHeight;
184 host_->SetBounds(x(), running_y, width(), height() - running_y); 186 host_->SetBounds(x(), running_y, width(), height() - running_y);
185 } 187 }
(...skipping 21 matching lines...) Expand all
207 209
208 void ChildModalParent::OnWidgetClosing(Widget* widget) { 210 void ChildModalParent::OnWidgetClosing(Widget* widget) {
209 if (child_) { 211 if (child_) {
210 DCHECK_EQ(child_, widget); 212 DCHECK_EQ(child_, widget);
211 child_ = NULL; 213 child_ = NULL;
212 } 214 }
213 } 215 }
214 216
215 } // namespace test 217 } // namespace test
216 } // namespace views 218 } // namespace views
OLDNEW
« no previous file with comments | « ui/oak/oak_window.cc ('k') | ui/views/widget/widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698