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" |
11 #include "chrome/browser/chromeos/frame/bubble_window.h" | |
12 #include "chrome/browser/ui/dialog_style.h" | 11 #include "chrome/browser/ui/dialog_style.h" |
13 #include "chrome/browser/ui/views/window.h" | 12 #include "chrome/browser/ui/views/window.h" |
14 #include "ui/base/gtk/gtk_signal.h" | 13 #include "ui/base/gtk/gtk_signal.h" |
15 #include "ui/views/controls/native/native_view_host.h" | 14 #include "ui/views/controls/native/native_view_host.h" |
16 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
17 #include "ui/views/window/dialog_delegate.h" | 16 #include "ui/views/window/dialog_delegate.h" |
18 #include "ui/views/window/non_client_view.h" | 17 #include "ui/views/window/non_client_view.h" |
19 | 18 |
20 namespace { | 19 namespace { |
21 | 20 |
22 const int kDialogPadding = 3; | 21 const int kDialogPadding = 3; |
23 | 22 |
24 const char kNativeDialogHost[] = "_chromeos_native_dialog_host_"; | 23 const char kNativeDialogHost[] = "_chromeos_native_dialog_host_"; |
25 | 24 |
| 25 const SkColor kBubbleWindowBackgroundColor = SK_ColorWHITE; |
| 26 |
26 // TODO(xiyuan): Use gtk_window_get_default_widget with GTK 2.14+. | 27 // TODO(xiyuan): Use gtk_window_get_default_widget with GTK 2.14+. |
27 // Gets the default widget of given dialog. | 28 // Gets the default widget of given dialog. |
28 GtkWidget* GetDialogDefaultWidget(GtkDialog* dialog) { | 29 GtkWidget* GetDialogDefaultWidget(GtkDialog* dialog) { |
29 GtkWidget* default_widget = NULL; | 30 GtkWidget* default_widget = NULL; |
30 | 31 |
31 GList* children = gtk_container_get_children( | 32 GList* children = gtk_container_get_children( |
32 GTK_CONTAINER(dialog->action_area)); | 33 GTK_CONTAINER(dialog->action_area)); |
33 | 34 |
34 GList* current = children; | 35 GList* current = children; |
35 while (current) { | 36 while (current) { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return host ? host->GetWidget()->GetNativeWindow() : NULL; | 343 return host ? host->GetWidget()->GetNativeWindow() : NULL; |
343 } | 344 } |
344 | 345 |
345 gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) { | 346 gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) { |
346 NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>( | 347 NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>( |
347 g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost)); | 348 g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost)); |
348 return host ? host->bounds() : gfx::Rect(); | 349 return host ? host->bounds() : gfx::Rect(); |
349 } | 350 } |
350 | 351 |
351 } // namespace chromeos | 352 } // namespace chromeos |
OLD | NEW |