OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_IMPORT_DIALOG_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_IMPORT_DIALOG_GTK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "app/gtk_signal.h" |
| 10 #include "chrome/browser/importer/importer.h" |
| 11 |
| 12 class AccessibleWidgetHelper; |
| 13 class Profile; |
| 14 |
| 15 class ImportDialogGtk : public ImportObserver, |
| 16 public ImporterList::Observer { |
| 17 public: |
| 18 // Displays the import box to import data from another browser into |profile| |
| 19 // |initial_state| is a bitmask of ImportItems. Each checkbox for the bits in |
| 20 // is checked. |
| 21 static void Show(GtkWindow* parent, Profile* profile, int initial_state); |
| 22 |
| 23 // ImportObserver implementation. |
| 24 virtual void ImportCanceled(); |
| 25 virtual void ImportComplete(); |
| 26 |
| 27 private: |
| 28 ImportDialogGtk(GtkWindow* parent, Profile* profile, int initial_state); |
| 29 ~ImportDialogGtk(); |
| 30 |
| 31 // ImporterList::Observer implementation. |
| 32 virtual void SourceProfilesLoaded(); |
| 33 |
| 34 // Handler to respond to OK or Cancel responses from the dialog. |
| 35 CHROMEGTK_CALLBACK_1(ImportDialogGtk, void, OnDialogResponse, int); |
| 36 |
| 37 // Handler to respond to widget clicked actions from the dialog. |
| 38 CHROMEGTK_CALLBACK_0(ImportDialogGtk, void, OnDialogWidgetClicked); |
| 39 |
| 40 // Enable or disable the dialog buttons depending on the state of the |
| 41 // checkboxes. |
| 42 void UpdateDialogButtons(); |
| 43 |
| 44 // Sets the sensitivity of all controls on the dialog except the cancel |
| 45 // button. |
| 46 void SetDialogControlsSensitive(bool sensitive); |
| 47 |
| 48 // Create a bitmask from the checkboxes of the dialog. |
| 49 uint16 GetCheckedItems(); |
| 50 |
| 51 // Parent window |
| 52 GtkWindow* parent_; |
| 53 |
| 54 // Import Dialog |
| 55 GtkWidget* dialog_; |
| 56 |
| 57 // Combo box that displays list of profiles from which we can import. |
| 58 GtkWidget* combo_; |
| 59 |
| 60 // Bookmarks/Favorites checkbox |
| 61 GtkWidget* bookmarks_; |
| 62 |
| 63 // Search Engines checkbox |
| 64 GtkWidget* search_engines_; |
| 65 |
| 66 // Passwords checkbox |
| 67 GtkWidget* passwords_; |
| 68 |
| 69 // History checkbox |
| 70 GtkWidget* history_; |
| 71 |
| 72 // Import button. |
| 73 GtkWidget* import_button_; |
| 74 |
| 75 // Our current profile |
| 76 Profile* profile_; |
| 77 |
| 78 // Utility class that does the actual import. |
| 79 scoped_refptr<ImporterHost> importer_host_; |
| 80 |
| 81 int initial_state_; |
| 82 |
| 83 // Helper object to manage accessibility metadata. |
| 84 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; |
| 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(ImportDialogGtk); |
| 87 }; |
| 88 |
| 89 #endif // CHROME_BROWSER_UI_GTK_IMPORT_DIALOG_GTK_H_ |
OLD | NEW |