summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run/first_run.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 23:23:08 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 23:23:08 +0000
commit58d7bb5fc1d079213e852c28d0557f17907e8ba6 (patch)
tree8b527c3e7522ee5f8f51b0a788bf33095522302e /chrome/browser/first_run/first_run.cc
parenta0798ecd866df57352c628ee6adf191a3fdc865e (diff)
downloadchromium_src-58d7bb5fc1d079213e852c28d0557f17907e8ba6.zip
chromium_src-58d7bb5fc1d079213e852c28d0557f17907e8ba6.tar.gz
chromium_src-58d7bb5fc1d079213e852c28d0557f17907e8ba6.tar.bz2
importer: Factor out StartImportingWithUI() function in its own file.
- Move this function to importer_progress_dialog.h - Rename it ShowImportProgressDialog. - Put it under the importer namespace (so the callers can know where it comes from). - Reorder the parameters to be more easy to read. - Remove some using declarations. BUG=None TEST=importer unit tests and importing works as before. Review URL: http://codereview.chromium.org/6597095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run/first_run.cc')
-rw-r--r--chrome/browser/first_run/first_run.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 2cb6a45..51805a6 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -4,20 +4,13 @@
#include "chrome/browser/first_run/first_run.h"
-#include "build/build_config.h"
-
-// TODO(port): move more code in back from the first_run_win.cc module.
-
-#if defined(OS_WIN)
-#include "chrome/installer/util/google_update_settings.h"
-#include "chrome/installer/util/install_util.h"
-#endif
-
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/utf_string_conversions.h"
+#include "build/build_config.h"
#include "chrome/browser/importer/importer.h"
+#include "chrome/browser/importer/importer_progress_dialog.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/process_singleton.h"
@@ -31,6 +24,12 @@
#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
+// TODO(port): move more code in back from the first_run_win.cc module.
+#if defined(OS_WIN)
+#include "chrome/installer/util/google_update_settings.h"
+#include "chrome/installer/util/install_util.h"
+#endif
+
namespace {
// The kSentinelFile file absence will tell us it is a first run.
@@ -426,25 +425,25 @@ int FirstRun::ImportFromFile(Profile* profile, const CommandLine& cmdline) {
return false;
}
scoped_refptr<ImporterHost> importer_host(new ImporterHost);
- FirstRunImportObserver observer;
+ FirstRunImportObserver importer_observer;
importer_host->set_headless();
- ProfileInfo profile_info;
+ importer::ProfileInfo profile_info;
profile_info.browser_type = importer::BOOKMARKS_HTML;
profile_info.source_path = file_path;
- StartImportingWithUI(
+ importer::ShowImportProgressDialog(
NULL,
importer::FAVORITES,
importer_host,
+ &importer_observer,
profile_info,
profile,
- &observer,
true);
- observer.RunLoop();
- return observer.import_result();
+ importer_observer.RunLoop();
+ return importer_observer.import_result();
}
// static
@@ -680,7 +679,8 @@ bool FirstRun::ImportSettings(Profile* profile,
scoped_refptr<ImporterHost> importer_host,
scoped_refptr<ImporterList> importer_list,
int items_to_import) {
- const ProfileInfo& source_profile = importer_list->GetSourceProfileInfoAt(0);
+ const importer::ProfileInfo& source_profile =
+ importer_list->GetSourceProfileInfoAt(0);
// Ensure that importers aren't requested to import items that they do not
// support.