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

Side by Side Diff: chrome/browser/gtk/repost_form_warning_gtk.cc

Issue 1657005: Merge 44481 - Ensure proper teardown of repost form warning objects.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/375/src/
Patch Set: Created 10 years, 8 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/gtk/repost_form_warning_gtk.h" 5 #include "chrome/browser/gtk/repost_form_warning_gtk.h"
6 6
7 #include "app/gtk_util.h" 7 #include "app/gtk_util.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/gtk/gtk_util.h" 10 #include "chrome/browser/gtk/gtk_util.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 G_CALLBACK(OnHierarchyChangedThunk), this); 58 G_CALLBACK(OnHierarchyChangedThunk), this);
59 59
60 controller_->Show(this); 60 controller_->Show(this);
61 } 61 }
62 62
63 GtkWidget* RepostFormWarningGtk::GetWidgetRoot() { 63 GtkWidget* RepostFormWarningGtk::GetWidgetRoot() {
64 return dialog_; 64 return dialog_;
65 } 65 }
66 66
67 void RepostFormWarningGtk::DeleteDelegate() { 67 void RepostFormWarningGtk::DeleteDelegate() {
68 Dismiss();
69 delete this; 68 delete this;
70 } 69 }
71 70
72 RepostFormWarningGtk::~RepostFormWarningGtk() { 71 RepostFormWarningGtk::~RepostFormWarningGtk() {
73 } 72 gtk_widget_destroy(dialog_);
74
75 void RepostFormWarningGtk::Dismiss() {
76 if (dialog_) {
77 gtk_widget_destroy(dialog_);
78 dialog_ = NULL;
79 }
80 } 73 }
81 74
82 void RepostFormWarningGtk::OnRefresh(GtkWidget* widget) { 75 void RepostFormWarningGtk::OnRefresh(GtkWidget* widget) {
83 controller_->Continue(); 76 controller_->Continue();
84 } 77 }
85 78
86 void RepostFormWarningGtk::OnCancel(GtkWidget* widget) { 79 void RepostFormWarningGtk::OnCancel(GtkWidget* widget) {
87 controller_->Cancel(); 80 controller_->Cancel();
88 } 81 }
89 82
90 void RepostFormWarningGtk::OnHierarchyChanged(GtkWidget* root, 83 void RepostFormWarningGtk::OnHierarchyChanged(GtkWidget* root,
91 GtkWidget* previous_toplevel) { 84 GtkWidget* previous_toplevel) {
92 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 85 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
93 if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(cancel_))) { 86 if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(cancel_))) {
94 return; 87 return;
95 } 88 }
96 gtk_widget_grab_focus(cancel_); 89 gtk_widget_grab_focus(cancel_);
97 } 90 }
98 91
OLDNEW
« no previous file with comments | « chrome/browser/gtk/repost_form_warning_gtk.h ('k') | chrome/browser/repost_form_warning_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698