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