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

Unified Diff: chrome/browser/ui/gtk/process_singleton_dialog.cc

Issue 23506011: Improve the UI for handling profile lock contention. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix XML syntax errur?! Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/process_singleton_dialog.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/ui/gtk/process_singleton_dialog.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698