OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/web_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/web_dialog_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/property_bag.h" | 9 #include "base/property_bag.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 using content::WebContents; | 24 using content::WebContents; |
25 using content::WebUIMessageHandler; | 25 using content::WebUIMessageHandler; |
26 | 26 |
27 namespace browser { | 27 namespace browser { |
28 | 28 |
29 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, | 29 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, |
30 Profile* profile, | 30 Profile* profile, |
31 Browser* browser, | 31 Browser* browser, |
32 WebDialogDelegate* delegate) { | 32 WebDialogDelegate* delegate) { |
33 // Ignore style for now. The style parameter only used in the implementation | |
34 // in web_dialog_view.cc file. | |
35 WebDialogGtk* web_dialog = | 33 WebDialogGtk* web_dialog = |
36 new WebDialogGtk(profile, browser, delegate, parent); | 34 new WebDialogGtk(profile, browser, delegate, parent); |
37 return web_dialog->InitDialog(); | 35 return web_dialog->InitDialog(); |
38 } | 36 } |
39 | 37 |
40 void CloseWebDialog(gfx::NativeWindow window) { | |
41 gtk_dialog_response(GTK_DIALOG(window), GTK_RESPONSE_CLOSE); | |
42 } | |
43 | |
44 } // namespace browser | 38 } // namespace browser |
45 | 39 |
46 namespace { | 40 namespace { |
47 | 41 |
48 void SetDialogStyle() { | 42 void SetDialogStyle() { |
49 static bool style_was_set = false; | 43 static bool style_was_set = false; |
50 | 44 |
51 if (style_was_set) | 45 if (style_was_set) |
52 return; | 46 return; |
53 style_was_set = true; | 47 style_was_set = true; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 259 } |
266 | 260 |
267 gtk_widget_show_all(dialog_); | 261 gtk_widget_show_all(dialog_); |
268 | 262 |
269 return GTK_WINDOW(dialog_); | 263 return GTK_WINDOW(dialog_); |
270 } | 264 } |
271 | 265 |
272 void WebDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 266 void WebDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
273 OnDialogClosed(std::string()); | 267 OnDialogClosed(std::string()); |
274 } | 268 } |
OLD | NEW |