| 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/common/platform_util.h" | 5 #include "chrome/common/platform_util.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "base/singleton.h" |
| 11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 12 #include "chrome/common/gtk_util.h" | 13 #include "chrome/common/gtk_util.h" |
| 13 #include "chrome/common/process_watcher.h" | 14 #include "chrome/common/process_watcher.h" |
| 14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 void XDGOpen(const std::string& path) { | 19 void XDGOpen(const std::string& path) { |
| 19 std::vector<std::string> argv; | 20 std::vector<std::string> argv; |
| 20 argv.push_back("xdg-open"); | 21 argv.push_back("xdg-open"); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const string16& title, | 81 const string16& title, |
| 81 const string16& message) { | 82 const string16& message) { |
| 82 GtkWidget* dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, | 83 GtkWidget* dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, |
| 83 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); | 84 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); |
| 84 gtk_util::ApplyMessageDialogQuirks(dialog); | 85 gtk_util::ApplyMessageDialogQuirks(dialog); |
| 85 gtk_window_set_title(GTK_WINDOW(dialog), UTF16ToUTF8(title).c_str()); | 86 gtk_window_set_title(GTK_WINDOW(dialog), UTF16ToUTF8(title).c_str()); |
| 86 g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); | 87 g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); |
| 87 gtk_widget_show_all(dialog); | 88 gtk_widget_show_all(dialog); |
| 88 } | 89 } |
| 89 | 90 |
| 91 RendererPreferences GetInitedRendererPreferences() { |
| 92 RendererPreferences* prefs = Singleton<RendererPreferences>::get(); |
| 93 static bool inited = false; |
| 94 if (!inited) { |
| 95 gtk_util::InitRendererPrefsFromGtkSettings(prefs); |
| 96 inited = true; |
| 97 } |
| 98 return *prefs; |
| 99 } |
| 100 |
| 90 } // namespace platform_util | 101 } // namespace platform_util |
| OLD | NEW |