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/chromeos/native_dialog_window.h" | 5 #include "chrome/browser/chromeos/native_dialog_window.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Gets the default widget of given dialog. | 26 // Gets the default widget of given dialog. |
27 GtkWidget* GetDialogDefaultWidget(GtkDialog* dialog) { | 27 GtkWidget* GetDialogDefaultWidget(GtkDialog* dialog) { |
28 GtkWidget* default_widget = NULL; | 28 GtkWidget* default_widget = NULL; |
29 | 29 |
30 GList* children = gtk_container_get_children( | 30 GList* children = gtk_container_get_children( |
31 GTK_CONTAINER(dialog->action_area)); | 31 GTK_CONTAINER(dialog->action_area)); |
32 | 32 |
33 GList* current = children; | 33 GList* current = children; |
34 while (current) { | 34 while (current) { |
35 GtkWidget* widget = reinterpret_cast<GtkWidget*>(current->data); | 35 GtkWidget* widget = reinterpret_cast<GtkWidget*>(current->data); |
36 if (GTK_WIDGET_HAS_DEFAULT(widget)) { | 36 if (gtk_widget_has_default(widget)) { |
37 default_widget = widget; | 37 default_widget = widget; |
38 break; | 38 break; |
39 } | 39 } |
40 | 40 |
41 current = g_list_next(current); | 41 current = g_list_next(current); |
42 } | 42 } |
43 | 43 |
44 g_list_free(children); | 44 g_list_free(children); |
45 | 45 |
46 return default_widget; | 46 return default_widget; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 return host ? host->GetWidget()->GetNativeWindow() : NULL; | 281 return host ? host->GetWidget()->GetNativeWindow() : NULL; |
282 } | 282 } |
283 | 283 |
284 gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) { | 284 gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) { |
285 NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>( | 285 NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>( |
286 g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost)); | 286 g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost)); |
287 return host ? host->bounds() : gfx::Rect(); | 287 return host ? host->bounds() : gfx::Rect(); |
288 } | 288 } |
289 | 289 |
290 } // namespace chromeos | 290 } // namespace chromeos |
OLD | NEW |