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

Side by Side Diff: ui/views/widget/widget_delegate.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/views/widget/widget_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('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/widget/widget_delegate.h" 5 #include "ui/views/widget/widget_delegate.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/gfx/image/image_skia.h" 8 #include "ui/gfx/image/image_skia.h"
9 #include "ui/views/bubble/bubble_delegate.h" 9 #include "ui/views/bubble/bubble_delegate.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 bool WidgetDelegate::ShouldDescendIntoChildForEventHandling( 153 bool WidgetDelegate::ShouldDescendIntoChildForEventHandling(
154 gfx::NativeView child, 154 gfx::NativeView child,
155 const gfx::Point& location) { 155 const gfx::Point& location) {
156 return true; 156 return true;
157 } 157 }
158 158
159 //////////////////////////////////////////////////////////////////////////////// 159 ////////////////////////////////////////////////////////////////////////////////
160 // WidgetDelegateView: 160 // WidgetDelegateView:
161 161
162 WidgetDelegateView::WidgetDelegateView() { 162 WidgetDelegateView::WidgetDelegateView() {
163 // A WidgetDelegate should be deleted on DeleteDelegate.
164 set_owned_by_client();
163 } 165 }
164 166
165 WidgetDelegateView::~WidgetDelegateView() { 167 WidgetDelegateView::~WidgetDelegateView() {
166 } 168 }
167 169
170 void WidgetDelegateView::DeleteDelegate() {
171 delete this;
172 }
173
168 Widget* WidgetDelegateView::GetWidget() { 174 Widget* WidgetDelegateView::GetWidget() {
169 return View::GetWidget(); 175 return View::GetWidget();
170 } 176 }
171 177
172 const Widget* WidgetDelegateView::GetWidget() const { 178 const Widget* WidgetDelegateView::GetWidget() const {
173 return View::GetWidget(); 179 return View::GetWidget();
174 } 180 }
175 181
176 } // namespace views 182 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698