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

Unified Diff: views/widget/widget.cc

Issue 7189019: Fix even more crashes. To help identify remaining crashes now and in the future, I have made the ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: views/widget/widget.cc
===================================================================
--- views/widget/widget.cc (revision 89357)
+++ views/widget/widget.cc (working copy)
@@ -60,15 +60,23 @@
// WidgetDelegate is supplied.
class DefaultWidgetDelegate : public WidgetDelegate {
public:
- DefaultWidgetDelegate() {}
+ explicit DefaultWidgetDelegate(Widget* widget) : widget_(widget) {}
virtual ~DefaultWidgetDelegate() {}
// Overridden from WidgetDelegate:
virtual void DeleteDelegate() OVERRIDE {
delete this;
}
+ virtual Widget* GetWidget() {
+ return widget_;
+ }
+ virtual const Widget* GetWidget() const {
+ return widget_;
+ }
private:
+ Widget* widget_;
+
DISALLOW_COPY_AND_ASSIGN(DefaultWidgetDelegate);
};
@@ -246,7 +254,7 @@
void Widget::Init(const InitParams& params) {
widget_delegate_ =
- params.delegate ? params.delegate : new DefaultWidgetDelegate;
+ params.delegate ? params.delegate : new DefaultWidgetDelegate(this);
ownership_ = params.ownership;
native_widget_ = params.native_widget ?
params.native_widget->AsNativeWidgetPrivate() :

Powered by Google App Engine
This is Rietveld 408576698