| 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/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "chrome/common/gtk_util.h" |
| 12 #include "chrome/common/process_watcher.h" | 13 #include "chrome/common/process_watcher.h" |
| 13 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 void XDGOpen(const std::string& path) { | 18 void XDGOpen(const std::string& path) { |
| 18 std::vector<std::string> argv; | 19 std::vector<std::string> argv; |
| 19 argv.push_back("xdg-open"); | 20 argv.push_back("xdg-open"); |
| 20 argv.push_back(path); | 21 argv.push_back(path); |
| 21 | 22 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 74 |
| 74 bool IsVisible(gfx::NativeView view) { | 75 bool IsVisible(gfx::NativeView view) { |
| 75 return GTK_WIDGET_VISIBLE(view); | 76 return GTK_WIDGET_VISIBLE(view); |
| 76 } | 77 } |
| 77 | 78 |
| 78 void SimpleErrorBox(gfx::NativeWindow parent, | 79 void SimpleErrorBox(gfx::NativeWindow parent, |
| 79 const string16& title, | 80 const string16& title, |
| 80 const string16& message) { | 81 const string16& message) { |
| 81 GtkWidget* dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, | 82 GtkWidget* dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, |
| 82 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); | 83 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); |
| 84 gtk_util::ApplyMessageDialogQuirks(dialog); |
| 83 gtk_window_set_title(GTK_WINDOW(dialog), UTF16ToUTF8(title).c_str()); | 85 gtk_window_set_title(GTK_WINDOW(dialog), UTF16ToUTF8(title).c_str()); |
| 84 g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); | 86 g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); |
| 85 gtk_widget_show_all(dialog); | 87 gtk_widget_show_all(dialog); |
| 86 } | 88 } |
| 87 | 89 |
| 88 } // namespace platform_util | 90 } // namespace platform_util |
| OLD | NEW |