summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/gtk/first_run_dialog.cc13
-rw-r--r--chrome/browser/gtk/first_run_dialog.h15
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_;