| 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/gtk/repost_form_warning_gtk.h" | 5 #include "chrome/browser/gtk/repost_form_warning_gtk.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/tab_contents/navigation_controller.h" | 9 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 10 #include "chrome/common/gtk_util.h" | 10 #include "chrome/common/gtk_util.h" |
| 11 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
| 12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 13 | 13 |
| 14 RepostFormWarningGtk::RepostFormWarningGtk( | 14 RepostFormWarningGtk::RepostFormWarningGtk( |
| 15 GtkWindow* parent, | 15 GtkWindow* parent, |
| 16 NavigationController* navigation_controller) | 16 NavigationController* navigation_controller) |
| 17 : navigation_controller_(navigation_controller) { | 17 : navigation_controller_(navigation_controller) { |
| 18 dialog_ = gtk_message_dialog_new( | 18 dialog_ = gtk_message_dialog_new( |
| 19 parent, | 19 parent, |
| 20 GTK_DIALOG_MODAL, | 20 GTK_DIALOG_MODAL, |
| 21 GTK_MESSAGE_QUESTION, | 21 GTK_MESSAGE_QUESTION, |
| 22 GTK_BUTTONS_NONE, | 22 GTK_BUTTONS_NONE, |
| 23 "%s", | 23 "%s", |
| 24 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING).c_str()); | 24 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING).c_str()); |
| 25 gtk_util::ApplyMessageDialogQuirks(dialog_); |
| 25 gtk_window_set_title(GTK_WINDOW(dialog_), | 26 gtk_window_set_title(GTK_WINDOW(dialog_), |
| 26 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING_TITLE).c_str()); | 27 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING_TITLE).c_str()); |
| 27 gtk_util::AddButtonToDialog(dialog_, | 28 gtk_util::AddButtonToDialog(dialog_, |
| 28 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING_CANCEL).c_str(), | 29 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING_CANCEL).c_str(), |
| 29 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); | 30 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); |
| 30 gtk_util::AddButtonToDialog(dialog_, | 31 gtk_util::AddButtonToDialog(dialog_, |
| 31 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING_RESEND).c_str(), | 32 l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING_RESEND).c_str(), |
| 32 GTK_STOCK_REFRESH, GTK_RESPONSE_OK); | 33 GTK_STOCK_REFRESH, GTK_RESPONSE_OK); |
| 33 gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); | 34 gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); |
| 34 | 35 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 if (dialog->navigation_controller_) | 78 if (dialog->navigation_controller_) |
| 78 dialog->navigation_controller_->Reload(false); | 79 dialog->navigation_controller_->Reload(false); |
| 79 } | 80 } |
| 80 } | 81 } |
| 81 | 82 |
| 82 // static | 83 // static |
| 83 void RepostFormWarningGtk::OnWindowDestroy(GtkWidget* widget, | 84 void RepostFormWarningGtk::OnWindowDestroy(GtkWidget* widget, |
| 84 RepostFormWarningGtk* dialog) { | 85 RepostFormWarningGtk* dialog) { |
| 85 MessageLoop::current()->DeleteSoon(FROM_HERE, dialog); | 86 MessageLoop::current()->DeleteSoon(FROM_HERE, dialog); |
| 86 } | 87 } |
| OLD | NEW |