OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |