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

Side by Side Diff: chrome/browser/gtk/process_singleton_dialog.cc

Issue 425016: Linux: Create app modal dialogs in a different way to work around a KDE 3 win... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: with missing files Created 11 years 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 | Annotate | Revision Log
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/gtk/process_singleton_dialog.h" 5 #include "chrome/browser/gtk/process_singleton_dialog.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/common/gtk_util.h" 9 #include "chrome/common/gtk_util.h"
10 #include "grit/chromium_strings.h" 10 #include "grit/chromium_strings.h"
11 11
12 // static 12 // static
13 void ProcessSingletonDialog::ShowAndRun(const std::string& message) { 13 void ProcessSingletonDialog::ShowAndRun(const std::string& message) {
14 ProcessSingletonDialog dialog(message); 14 ProcessSingletonDialog dialog(message);
15 } 15 }
16 16
17 ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) { 17 ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) {
18 dialog_ = gtk_message_dialog_new( 18 dialog_ = gtk_message_dialog_new(
19 NULL, 19 NULL,
20 static_cast<GtkDialogFlags>(0), 20 static_cast<GtkDialogFlags>(0),
21 GTK_MESSAGE_ERROR, 21 GTK_MESSAGE_ERROR,
22 GTK_BUTTONS_NONE, 22 GTK_BUTTONS_NONE,
23 "%s", 23 "%s",
24 message.c_str()); 24 message.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_PRODUCT_NAME).c_str()); 27 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str());
27 gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_QUIT, 28 gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_QUIT,
28 GTK_RESPONSE_REJECT); 29 GTK_RESPONSE_REJECT);
29 30
30 g_signal_connect(G_OBJECT(dialog_), "response", 31 g_signal_connect(G_OBJECT(dialog_), "response",
31 G_CALLBACK(OnResponse), this); 32 G_CALLBACK(OnResponse), this);
32 33
33 gtk_widget_show_all(dialog_); 34 gtk_widget_show_all(dialog_);
34 MessageLoop::current()->Run(); 35 MessageLoop::current()->Run();
35 } 36 }
36 37
37 // static 38 // static
38 void ProcessSingletonDialog::OnResponse(GtkWidget* widget, int response, 39 void ProcessSingletonDialog::OnResponse(GtkWidget* widget, int response,
39 ProcessSingletonDialog* dialog) { 40 ProcessSingletonDialog* dialog) {
40 gtk_widget_destroy(dialog->dialog_); 41 gtk_widget_destroy(dialog->dialog_);
41 MessageLoop::current()->Quit(); 42 MessageLoop::current()->Quit();
42 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/options/passwords_page_gtk.cc ('k') | chrome/browser/gtk/repost_form_warning_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698