diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 21:15:52 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 21:15:52 +0000 |
commit | 009bac9dfb6ae322bfb3d7b957f29cfd4accfe3b (patch) | |
tree | 82806e16cd46ede4f4c9b755f8a8a32d922b774b | |
parent | 4f0613908b2847d5e20926246266d551bf3e7120 (diff) | |
download | chromium_src-009bac9dfb6ae322bfb3d7b957f29cfd4accfe3b.zip chromium_src-009bac9dfb6ae322bfb3d7b957f29cfd4accfe3b.tar.gz chromium_src-009bac9dfb6ae322bfb3d7b957f29cfd4accfe3b.tar.bz2 |
Show progress Window when importing profile from First Run dialog.
Review URL: http://codereview.chromium.org/149766
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20898 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/first_run_dialog.cc | 13 | ||||
-rw-r--r-- | chrome/browser/gtk/first_run_dialog.h | 15 |
2 files changed, 23 insertions, 5 deletions
diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc index 135fc60..1ada23b 100644 --- a/chrome/browser/gtk/first_run_dialog.cc +++ b/chrome/browser/gtk/first_run_dialog.cc @@ -155,13 +155,18 @@ void FirstRunDialog::OnDialogResponse(GtkWidget* widget, int response) { importer_host_->GetSourceProfileInfoAt( gtk_combo_box_get_active(GTK_COMBO_BOX(import_profile_))); int items = SEARCH_ENGINES + HISTORY + FAVORITES + HOME_PAGE + PASSWORDS; - // TODO(port): Call StartImportingWithUI here instead and launch - // a new process that does the actual import. - importer_host_->StartImportSettings(source_profile, profile_, items, - new ProfileWriter(profile_), true); + // TODO(port): Should we do the actual import in a new process like + // Windows? + StartImportingWithUI(GTK_WINDOW(dialog_), items, importer_host_.get(), + source_profile, profile_, this, true); + } else { + // We are done, so close Window. + FirstRunDone(); } } +} +void FirstRunDialog::FirstRunDone() { // Set preference to show first run bubble and welcome page. FirstRun::SetShowFirstRunBubblePref(); FirstRun::SetShowWelcomePagePref(); diff --git a/chrome/browser/gtk/first_run_dialog.h b/chrome/browser/gtk/first_run_dialog.h index cea21d3..bc68362 100644 --- a/chrome/browser/gtk/first_run_dialog.h +++ b/chrome/browser/gtk/first_run_dialog.h @@ -8,11 +8,19 @@ #include "chrome/browser/first_run.h" #include "chrome/browser/importer/importer.h" -class FirstRunDialog { +class FirstRunDialog : public ImportObserver { public: // Displays the first run UI for reporting opt-in, import data etc. static bool Show(Profile* profile); + // Overridden methods from ImportObserver. + virtual void ImportCanceled() { + FirstRunDone(); + } + virtual void ImportComplete() { + FirstRunDone(); + } + private: FirstRunDialog(Profile* profile, int& response); ~FirstRunDialog() { } @@ -24,6 +32,11 @@ class FirstRunDialog { } void OnDialogResponse(GtkWidget* widget, int response); + // This method closes the first run window and quits the message loop so that + // the Chrome startup can continue. This should be called when all the + // first run tasks are done. + void FirstRunDone(); + // First Run UI Dialog GtkWidget* dialog_; |