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

Side by Side Diff: chrome/browser/app_modal_dialog_gtk.cc

Issue 2803017: Fix a crash when we try to close a js dialog that wasn't shown. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/app_modal_dialog_win.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/app_modal_dialog.h" 5 #include "chrome/browser/app_modal_dialog.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/message_box_flags.h" 10 #include "app/message_box_flags.h"
(...skipping 13 matching lines...) Expand all
24 void AppModalDialog::CreateAndShowDialog() { 24 void AppModalDialog::CreateAndShowDialog() {
25 } 25 }
26 26
27 // static 27 // static
28 void AppModalDialog::OnDialogResponse(GtkDialog* dialog, gint response_id, 28 void AppModalDialog::OnDialogResponse(GtkDialog* dialog, gint response_id,
29 AppModalDialog* app_modal_dialog) { 29 AppModalDialog* app_modal_dialog) {
30 app_modal_dialog->HandleDialogResponse(dialog, response_id); 30 app_modal_dialog->HandleDialogResponse(dialog, response_id);
31 } 31 }
32 32
33 void AppModalDialog::ActivateModalDialog() { 33 void AppModalDialog::ActivateModalDialog() {
34 DCHECK(dialog_);
34 gtk_window_present(GTK_WINDOW(dialog_)); 35 gtk_window_present(GTK_WINDOW(dialog_));
35 } 36 }
36 37
37 void AppModalDialog::CloseModalDialog() { 38 void AppModalDialog::CloseModalDialog() {
39 DCHECK(dialog_);
38 HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); 40 HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT);
39 } 41 }
40 42
41 void AppModalDialog::AcceptWindow() { 43 void AppModalDialog::AcceptWindow() {
44 DCHECK(dialog_);
42 HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_OK); 45 HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_OK);
43 } 46 }
44 47
45 void AppModalDialog::CancelWindow() { 48 void AppModalDialog::CancelWindow() {
49 DCHECK(dialog_);
46 HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_CANCEL); 50 HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_CANCEL);
47 } 51 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/app_modal_dialog_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698