Index: chrome/browser/ui/gtk/process_singleton_dialog.cc |
diff --git a/chrome/browser/ui/gtk/process_singleton_dialog.cc b/chrome/browser/ui/gtk/process_singleton_dialog.cc |
index 75c25d7eed2bb00323e81c2064c299b3e466f84f..d6c8015848aec5258a0a7a5762945113959cbce5 100644 |
--- a/chrome/browser/ui/gtk/process_singleton_dialog.cc |
+++ b/chrome/browser/ui/gtk/process_singleton_dialog.cc |
@@ -12,11 +12,15 @@ |
#include "ui/base/l10n/l10n_util.h" |
// static |
-void ProcessSingletonDialog::ShowAndRun(const std::string& message) { |
- ProcessSingletonDialog dialog(message); |
+bool ProcessSingletonDialog::ShowAndRun(const std::string& message, |
+ const std::string& relaunch_text) { |
+ ProcessSingletonDialog dialog(message, relaunch_text); |
+ return dialog.GetResponseId() == GTK_RESPONSE_ACCEPT; |
} |
-ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) { |
+ProcessSingletonDialog::ProcessSingletonDialog( |
+ const std::string& message, |
+ const std::string& relaunch_text) { |
dialog_ = gtk_message_dialog_new( |
NULL, |
static_cast<GtkDialogFlags>(0), |
@@ -29,6 +33,9 @@ ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) { |
l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str()); |
gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_QUIT, |
GTK_RESPONSE_REJECT); |
+ gtk_dialog_add_button(GTK_DIALOG(dialog_), relaunch_text.c_str(), |
+ GTK_RESPONSE_ACCEPT); |
+ gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); |
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
@@ -37,6 +44,7 @@ ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) { |
} |
void ProcessSingletonDialog::OnResponse(GtkWidget* dialog, int response_id) { |
+ response_id_ = response_id; |
gtk_widget_destroy(dialog_); |
base::MessageLoop::current()->Quit(); |
} |