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

Side by Side Diff: ui/views/window/dialog_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/window/dialog_delegate.h ('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 "ui/views/window/dialog_delegate.h" 5 #include "ui/views/window/dialog_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/base/ui_base_switches.h" 9 #include "ui/base/ui_base_switches.h"
10 #include "ui/views/controls/button/text_button.h" 10 #include "ui/views/controls/button/text_button.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return GetWidget()->client_view()->AsDialogClientView(); 144 return GetWidget()->client_view()->AsDialogClientView();
145 } 145 }
146 146
147 ui::AccessibilityTypes::Role DialogDelegate::GetAccessibleWindowRole() const { 147 ui::AccessibilityTypes::Role DialogDelegate::GetAccessibleWindowRole() const {
148 return ui::AccessibilityTypes::ROLE_DIALOG; 148 return ui::AccessibilityTypes::ROLE_DIALOG;
149 } 149 }
150 150
151 //////////////////////////////////////////////////////////////////////////////// 151 ////////////////////////////////////////////////////////////////////////////////
152 // DialogDelegateView: 152 // DialogDelegateView:
153 153
154 DialogDelegateView::DialogDelegateView() {} 154 DialogDelegateView::DialogDelegateView() {
155 // A WidgetDelegate should be deleted on DeleteDelegate.
156 set_owned_by_client();
157 }
155 158
156 DialogDelegateView::~DialogDelegateView() {} 159 DialogDelegateView::~DialogDelegateView() {}
157 160
158 // static 161 // static
159 Widget* DialogDelegateView::CreateDialogWidget(DialogDelegateView* dialog, 162 Widget* DialogDelegateView::CreateDialogWidget(DialogDelegateView* dialog,
160 gfx::NativeWindow context, 163 gfx::NativeWindow context,
161 gfx::NativeWindow parent) { 164 gfx::NativeWindow parent) {
162 return CreateDialogWidgetImpl(dialog, context, parent); 165 return CreateDialogWidgetImpl(dialog, context, parent);
163 } 166 }
164 167
168 void DialogDelegateView::DeleteDelegate() {
169 delete this;
170 }
171
165 Widget* DialogDelegateView::GetWidget() { 172 Widget* DialogDelegateView::GetWidget() {
166 return View::GetWidget(); 173 return View::GetWidget();
167 } 174 }
168 175
169 const Widget* DialogDelegateView::GetWidget() const { 176 const Widget* DialogDelegateView::GetWidget() const {
170 return View::GetWidget(); 177 return View::GetWidget();
171 } 178 }
172 179
173 View* DialogDelegateView::GetContentsView() { 180 View* DialogDelegateView::GetContentsView() {
174 return this; 181 return this;
175 } 182 }
176 183
177 } // namespace views 184 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698