summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 18:35:11 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 18:35:11 +0000
commit76176e8ac414c60540d9dcd146c8198a2988136b (patch)
tree6c535e54e89aba5905189360c1928514361f8afb /chrome/browser/first_run
parentd2b21e8d4c93fb3c95693eed3ceae02a910e33b5 (diff)
downloadchromium_src-76176e8ac414c60540d9dcd146c8198a2988136b.zip
chromium_src-76176e8ac414c60540d9dcd146c8198a2988136b.tar.gz
chromium_src-76176e8ac414c60540d9dcd146c8198a2988136b.tar.bz2
importer: Cleanup ProfileInfo calls a little bit.
- Rename the struct from ProfileInfo to SourceProfile, so it makes a bit more sense. - Rename the ImporterList methods, removing the Info from the ProfileInfo, so it's just SourceProfile. - Forward declare SourceProfile struct whenever is possible. - Use uint16 for the bitmask of importer::ImportItem where is applicable. BUG=None TEST=None R=avi@chromium.org Review URL: http://codereview.chromium.org/6801004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80666 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r--chrome/browser/first_run/first_run.cc31
-rw-r--r--chrome/browser/first_run/first_run.h2
-rw-r--r--chrome/browser/first_run/first_run_win.cc8
3 files changed, 21 insertions, 20 deletions
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index dbbf3fe..9cc2e16 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -27,6 +27,7 @@
#include "chrome/installer/util/master_preferences.h"
#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
+#include "googleurl/src/gurl.h"
#if defined(OS_WIN)
// TODO(port): move more code in back from the first_run_win.cc module.
@@ -285,7 +286,7 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
scoped_refptr<ImporterList> importer_list(new ImporterList);
importer_list->DetectSourceProfilesHack();
if (!FirstRun::ImportSettings(NULL,
- importer_list->GetSourceProfileInfoAt(0).importer_type,
+ importer_list->GetSourceProfileAt(0).importer_type,
out_prefs->do_import_items,
FilePath::FromWStringHack(UTF8ToWide(import_bookmarks_path)),
true, NULL)) {
@@ -425,22 +426,20 @@ int FirstRun::ImportFromFile(Profile* profile, const CommandLine& cmdline) {
return false;
}
scoped_refptr<ImporterHost> importer_host(new ImporterHost);
- FirstRunImportObserver importer_observer;
-
importer_host->set_headless();
- importer::ProfileInfo profile_info;
- profile_info.importer_type = importer::BOOKMARKS_HTML;
- profile_info.source_path = file_path;
+ importer::SourceProfile source_profile;
+ source_profile.importer_type = importer::BOOKMARKS_HTML;
+ source_profile.source_path = file_path;
- importer::ShowImportProgressDialog(
- NULL,
- importer::FAVORITES,
- importer_host,
- &importer_observer,
- profile_info,
- profile,
- true);
+ FirstRunImportObserver importer_observer;
+ importer::ShowImportProgressDialog(NULL,
+ importer::FAVORITES,
+ importer_host,
+ &importer_observer,
+ source_profile,
+ profile,
+ true);
importer_observer.RunLoop();
return importer_observer.import_result();
@@ -675,8 +674,8 @@ bool FirstRun::ImportSettings(Profile* profile,
scoped_refptr<ImporterHost> importer_host,
scoped_refptr<ImporterList> importer_list,
int items_to_import) {
- const importer::ProfileInfo& source_profile =
- importer_list->GetSourceProfileInfoAt(0);
+ const importer::SourceProfile& source_profile =
+ importer_list->GetSourceProfileAt(0);
// Ensure that importers aren't requested to import items that they do not
// support.
diff --git a/chrome/browser/first_run/first_run.h b/chrome/browser/first_run/first_run.h
index d41c9be..8cb5861 100644
--- a/chrome/browser/first_run/first_run.h
+++ b/chrome/browser/first_run/first_run.h
@@ -13,11 +13,11 @@
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/importer/importer_observer.h"
#include "content/common/result_codes.h"
-#include "googleurl/src/gurl.h"
#include "ui/gfx/native_widget_types.h"
class CommandLine;
class FilePath;
+class GURL;
class Profile;
class ProcessSingleton;
class ImporterHost;
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index f72464e..9d963b1 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -498,9 +498,11 @@ bool FirstRun::ImportSettings(Profile* profile,
int items_to_import) {
return ImportSettings(
profile,
- importer_list->GetSourceProfileInfoAt(0).importer_type,
+ importer_list->GetSourceProfileAt(0).importer_type,
items_to_import,
- FilePath(), false, NULL);
+ FilePath(),
+ false,
+ NULL);
}
int FirstRun::ImportFromBrowser(Profile* profile,
@@ -535,7 +537,7 @@ int FirstRun::ImportFromBrowser(Profile* profile,
static_cast<uint16>(items_to_import),
importer_host,
&importer_observer,
- importer_list->GetSourceProfileInfoForImporterType(importer_type),
+ importer_list->GetSourceProfileForImporterType(importer_type),
profile,
true);
importer_observer.RunLoop();