OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/platform_util.h" | 5 #include "chrome/browser/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/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 bool IsWindowActive(gfx::NativeWindow window) { | 71 bool IsWindowActive(gfx::NativeWindow window) { |
72 return gtk_window_is_active(window); | 72 return gtk_window_is_active(window); |
73 } | 73 } |
74 | 74 |
75 void ActivateWindow(gfx::NativeWindow window) { | 75 void ActivateWindow(gfx::NativeWindow window) { |
76 gtk_window_present(window); | 76 gtk_window_present(window); |
77 } | 77 } |
78 | 78 |
79 bool IsVisible(gfx::NativeView view) { | 79 bool IsVisible(gfx::NativeView view) { |
80 return GTK_WIDGET_VISIBLE(view); | 80 return gtk_widget_get_visible(view); |
81 } | 81 } |
82 | 82 |
83 void SimpleErrorBox(gfx::NativeWindow parent, | 83 void SimpleErrorBox(gfx::NativeWindow parent, |
84 const string16& title, | 84 const string16& title, |
85 const string16& message) { | 85 const string16& message) { |
86 GtkWidget* dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, | 86 GtkWidget* dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, |
87 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); | 87 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); |
88 gtk_util::ApplyMessageDialogQuirks(dialog); | 88 gtk_util::ApplyMessageDialogQuirks(dialog); |
89 SetDialogTitle(dialog, title); | 89 SetDialogTitle(dialog, title); |
90 | 90 |
(...skipping 24 matching lines...) Expand all Loading... |
115 | 115 |
116 bool CanSetAsDefaultBrowser() { | 116 bool CanSetAsDefaultBrowser() { |
117 return true; | 117 return true; |
118 } | 118 } |
119 | 119 |
120 bool CanSetAsDefaultProtocolClient(const std::string& protocol) { | 120 bool CanSetAsDefaultProtocolClient(const std::string& protocol) { |
121 return CanSetAsDefaultBrowser(); | 121 return CanSetAsDefaultBrowser(); |
122 } | 122 } |
123 | 123 |
124 } // namespace platform_util | 124 } // namespace platform_util |
OLD | NEW |