OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GTK_IMPORT_DIALOG_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_IMPORT_DIALOG_GTK_H_ |
6 #define CHROME_BROWSER_GTK_IMPORT_DIALOG_GTK_H_ | 6 #define CHROME_BROWSER_GTK_IMPORT_DIALOG_GTK_H_ |
7 | 7 |
| 8 #include "app/gtk_signal.h" |
8 #include "chrome/browser/importer/importer.h" | 9 #include "chrome/browser/importer/importer.h" |
9 | 10 |
10 class AccessibleWidgetHelper; | 11 class AccessibleWidgetHelper; |
11 class Profile; | 12 class Profile; |
12 | 13 |
13 class ImportDialogGtk : public ImportObserver { | 14 class ImportDialogGtk : public ImportObserver { |
14 public: | 15 public: |
15 // Displays the import box to import data from another browser into |profile| | 16 // Displays the import box to import data from another browser into |profile| |
16 // |initial_state| is a bitmask of ImportItems. Each checkbox for the bits in | 17 // |initial_state| is a bitmask of ImportItems. Each checkbox for the bits in |
17 // is checked. | 18 // is checked. |
18 static void Show(GtkWindow* parent, Profile* profile, int initial_state); | 19 static void Show(GtkWindow* parent, Profile* profile, int initial_state); |
19 | 20 |
20 // Overridden from ImportObserver: | 21 // Overridden from ImportObserver: |
21 virtual void ImportCanceled(); | 22 virtual void ImportCanceled(); |
22 virtual void ImportComplete(); | 23 virtual void ImportComplete(); |
23 | 24 |
24 private: | 25 private: |
25 ImportDialogGtk(GtkWindow* parent, Profile* profile, int initial_state); | 26 ImportDialogGtk(GtkWindow* parent, Profile* profile, int initial_state); |
26 ~ImportDialogGtk(); | 27 ~ImportDialogGtk(); |
27 | 28 |
28 static void HandleOnResponseDialog(GtkWidget* widget, | 29 // Handler to respond to OK or Cancel responses from the dialog. |
29 int response, | 30 CHROMEGTK_CALLBACK_1(ImportDialogGtk, void, OnDialogResponse, int); |
30 ImportDialogGtk* user_data) { | 31 |
31 user_data->OnDialogResponse(widget, response); | 32 // Handler to respond to widget clicked actions from the dialog. |
32 } | 33 CHROMEGTK_CALLBACK_0(ImportDialogGtk, void, OnDialogWidgetClicked); |
33 void OnDialogResponse(GtkWidget* widget, int response); | 34 |
| 35 // Enable or disable the dialog buttons depending on the state of the |
| 36 // checkboxes. |
| 37 void UpdateDialogButtons(); |
| 38 |
| 39 // Create a bitmask from the checkboxes of the dialog. |
| 40 uint16 GetCheckedItems(); |
34 | 41 |
35 // Parent window | 42 // Parent window |
36 GtkWindow* parent_; | 43 GtkWindow* parent_; |
37 | 44 |
38 // Import Dialog | 45 // Import Dialog |
39 GtkWidget* dialog_; | 46 GtkWidget* dialog_; |
40 | 47 |
41 // Combo box that displays list of profiles from which we can import. | 48 // Combo box that displays list of profiles from which we can import. |
42 GtkWidget* combo_; | 49 GtkWidget* combo_; |
43 | 50 |
(...skipping 17 matching lines...) Expand all Loading... |
61 | 68 |
62 int initial_state_; | 69 int initial_state_; |
63 | 70 |
64 // Helper object to manage accessibility metadata. | 71 // Helper object to manage accessibility metadata. |
65 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; | 72 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; |
66 | 73 |
67 DISALLOW_COPY_AND_ASSIGN(ImportDialogGtk); | 74 DISALLOW_COPY_AND_ASSIGN(ImportDialogGtk); |
68 }; | 75 }; |
69 | 76 |
70 #endif // CHROME_BROWSER_GTK_IMPORT_DIALOG_GTK_H_ | 77 #endif // CHROME_BROWSER_GTK_IMPORT_DIALOG_GTK_H_ |
OLD | NEW |