| OLD | NEW |
| 1 // Copyright (c) 2010 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_GTK_IMPORT_PROGRESS_DIALOG_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_IMPORT_PROGRESS_DIALOG_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_IMPORT_PROGRESS_DIALOG_GTK_H_ | 6 #define CHROME_BROWSER_GTK_IMPORT_PROGRESS_DIALOG_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include "chrome/browser/ui/gtk/import_progress_dialog_gtk.h" |
| 10 | 10 // TODO(msw): remove this file once all includes have been updated. |
| 11 #include "chrome/browser/importer/importer.h" | |
| 12 #include "chrome/browser/importer/importer_data_types.h" | |
| 13 | |
| 14 class Profile; | |
| 15 | |
| 16 class ImportProgressDialogGtk : public ImporterHost::Observer { | |
| 17 public: | |
| 18 // Displays the import progress dialog box and starts the import | |
| 19 static void StartImport(GtkWindow* parent, int16 items, | |
| 20 ImporterHost* importer_host, | |
| 21 const ProfileInfo& browser_profile, | |
| 22 Profile* profile, | |
| 23 ImportObserver* observer, bool first_run); | |
| 24 | |
| 25 // Overridden from ImporterHost::Observer: | |
| 26 virtual void ImportItemStarted(importer::ImportItem item); | |
| 27 virtual void ImportItemEnded(importer::ImportItem item); | |
| 28 virtual void ImportStarted(); | |
| 29 virtual void ImportEnded(); | |
| 30 | |
| 31 private: | |
| 32 ImportProgressDialogGtk(const string16& source_profile, int16 items, | |
| 33 ImporterHost* importer_host, ImportObserver* observer, | |
| 34 GtkWindow* parent, bool bookmarks_import); | |
| 35 virtual ~ImportProgressDialogGtk(); | |
| 36 | |
| 37 static void HandleOnResponseDialog(GtkWidget* widget, | |
| 38 int response, | |
| 39 gpointer user_data) { | |
| 40 reinterpret_cast<ImportProgressDialogGtk*>(user_data)->OnDialogResponse( | |
| 41 widget, response); | |
| 42 } | |
| 43 | |
| 44 void CloseDialog(); | |
| 45 | |
| 46 void OnDialogResponse(GtkWidget* widget, int response); | |
| 47 | |
| 48 void ShowDialog(); | |
| 49 | |
| 50 // Parent window | |
| 51 GtkWindow* parent_; | |
| 52 | |
| 53 // Import progress dialog | |
| 54 GtkWidget* dialog_; | |
| 55 | |
| 56 // Bookmarks/Favorites checkbox | |
| 57 GtkWidget* bookmarks_; | |
| 58 | |
| 59 // Search Engines checkbox | |
| 60 GtkWidget* search_engines_; | |
| 61 | |
| 62 // Passwords checkbox | |
| 63 GtkWidget* passwords_; | |
| 64 | |
| 65 // History checkbox | |
| 66 GtkWidget* history_; | |
| 67 | |
| 68 // Boolean that tells whether we are currently in the mid of import process | |
| 69 bool importing_; | |
| 70 | |
| 71 // Observer that we need to notify about import events | |
| 72 ImportObserver* observer_; | |
| 73 | |
| 74 // Items to import from the other browser. | |
| 75 int16 items_; | |
| 76 | |
| 77 // Utility class that does the actual import. | |
| 78 scoped_refptr<ImporterHost> importer_host_; | |
| 79 | |
| 80 DISALLOW_COPY_AND_ASSIGN(ImportProgressDialogGtk); | |
| 81 }; | |
| 82 | 11 |
| 83 #endif // CHROME_BROWSER_GTK_IMPORT_PROGRESS_DIALOG_GTK_H_ | 12 #endif // CHROME_BROWSER_GTK_IMPORT_PROGRESS_DIALOG_GTK_H_ |
| OLD | NEW |