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 #ifndef CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_GTK_H_ |
6 #define CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_GTK_H_ | 6 #define CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "chrome/browser/ui/input_window_dialog.h" | 15 #include "chrome/browser/ui/input_window_dialog.h" |
16 #include "ui/base/gtk/gtk_signal.h" | 16 #include "ui/base/gtk/gtk_signal.h" |
17 | 17 |
18 class InputWindowDialogGtk : public InputWindowDialog { | 18 class InputWindowDialogGtk : public InputWindowDialog { |
19 public: | 19 public: |
20 // Creates a dialog. Takes ownership of |delegate|. | 20 // Creates a dialog. Takes ownership of |delegate|. |
21 InputWindowDialogGtk(GtkWindow* parent, | 21 InputWindowDialogGtk(GtkWindow* parent, |
22 const std::string& window_title, | 22 const std::string& window_title, |
23 const std::string& label, | 23 const std::string& label, |
24 const std::string& contents, | 24 const std::string& contents, |
25 Delegate* delegate); | 25 Delegate* delegate, |
| 26 ButtonType type); |
26 virtual ~InputWindowDialogGtk(); | 27 virtual ~InputWindowDialogGtk(); |
27 | 28 |
28 virtual void Show(); | 29 virtual void Show(); |
29 virtual void Close(); | 30 virtual void Close(); |
30 | 31 |
31 private: | 32 private: |
32 CHROMEG_CALLBACK_0(InputWindowDialogGtk, void, OnEntryChanged, GtkEditable*); | 33 CHROMEG_CALLBACK_0(InputWindowDialogGtk, void, OnEntryChanged, GtkEditable*); |
33 CHROMEGTK_CALLBACK_1(InputWindowDialogGtk, void, OnResponse, int); | 34 CHROMEGTK_CALLBACK_1(InputWindowDialogGtk, void, OnResponse, int); |
34 CHROMEGTK_CALLBACK_1(InputWindowDialogGtk, gboolean, | 35 CHROMEGTK_CALLBACK_1(InputWindowDialogGtk, gboolean, |
35 OnWindowDeleteEvent, GdkEvent*); | 36 OnWindowDeleteEvent, GdkEvent*); |
36 CHROMEGTK_CALLBACK_0(InputWindowDialogGtk, void, OnWindowDestroy); | 37 CHROMEGTK_CALLBACK_0(InputWindowDialogGtk, void, OnWindowDestroy); |
37 | 38 |
38 // The underlying gtk dialog window. | 39 // The underlying gtk dialog window. |
39 GtkWidget* dialog_; | 40 GtkWidget* dialog_; |
40 | 41 |
41 // The GtkEntry in this form. | 42 // The GtkEntry in this form. |
42 GtkWidget* input_; | 43 GtkWidget* input_; |
43 | 44 |
44 // Our delegate. Consumes the window's output. | 45 // Our delegate. Consumes the window's output. |
45 scoped_ptr<InputWindowDialog::Delegate> delegate_; | 46 scoped_ptr<InputWindowDialog::Delegate> delegate_; |
46 | 47 |
47 DISALLOW_COPY_AND_ASSIGN(InputWindowDialogGtk); | 48 DISALLOW_COPY_AND_ASSIGN(InputWindowDialogGtk); |
48 }; | 49 }; |
49 | 50 |
50 #endif // CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_GTK_H_ | 51 #endif // CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_GTK_H_ |
OLD | NEW |