summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 15:43:17 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 15:43:17 +0000
commite7192a95172a0a051704f6d60e96f2f41e67bf32 (patch)
tree5f090d6d2461482eb6fafa1988cabc16b19a8461 /chrome/browser/importer
parent56f762c6574feac5c7bc6fb3f7c80ca140c73566 (diff)
downloadchromium_src-e7192a95172a0a051704f6d60e96f2f41e67bf32.zip
chromium_src-e7192a95172a0a051704f6d60e96f2f41e67bf32.tar.gz
chromium_src-e7192a95172a0a051704f6d60e96f2f41e67bf32.tar.bz2
importer: Trivial change that changes NONE_IMPORTER to TYPE_UNKNOWN.
So while I'm here clean up the other importer types to make them prettier. BUG=None TEST=None R=mirandac@chromium.org Review URL: http://codereview.chromium.org/7387005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r--chrome/browser/importer/firefox2_importer.cc2
-rw-r--r--chrome/browser/importer/importer_data_types.cc2
-rw-r--r--chrome/browser/importer/importer_host.cc6
-rw-r--r--chrome/browser/importer/importer_list.cc22
-rw-r--r--chrome/browser/importer/importer_type.cc18
-rw-r--r--chrome/browser/importer/importer_type.h14
-rw-r--r--chrome/browser/importer/importer_unittest.cc6
7 files changed, 35 insertions, 35 deletions
diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc
index 0e1899e6..f929b01 100644
--- a/chrome/browser/importer/firefox2_importer.cc
+++ b/chrome/browser/importer/firefox2_importer.cc
@@ -55,7 +55,7 @@ void Firefox2Importer::StartImport(
app_path_ = source_profile.app_path;
parsing_bookmarks_html_file_ =
- (source_profile.importer_type == importer::BOOKMARKS_HTML);
+ (source_profile.importer_type == importer::TYPE_BOOKMARKS_FILE);
// The order here is important!
bridge_->NotifyStarted();
diff --git a/chrome/browser/importer/importer_data_types.cc b/chrome/browser/importer/importer_data_types.cc
index e9c7305..a178fc2 100644
--- a/chrome/browser/importer/importer_data_types.cc
+++ b/chrome/browser/importer/importer_data_types.cc
@@ -7,7 +7,7 @@
namespace importer {
SourceProfile::SourceProfile()
- : importer_type(NONE_IMPORTER),
+ : importer_type(TYPE_UNKNOWN),
services_supported(0) {
}
diff --git a/chrome/browser/importer/importer_host.cc b/chrome/browser/importer/importer_host.cc
index 0ea0147..39fc5d7 100644
--- a/chrome/browser/importer/importer_host.cc
+++ b/chrome/browser/importer/importer_host.cc
@@ -132,7 +132,7 @@ void ImporterHost::StartImportSettings(
#if defined(OS_WIN)
// For google toolbar import, we need the user to log in and store their GAIA
// credentials.
- if (source_profile.importer_type == importer::GOOGLE_TOOLBAR5) {
+ if (source_profile.importer_type == importer::TYPE_GOOGLE_TOOLBAR5) {
toolbar_importer_utils::IsGoogleGAIACookieInstalled(
base::Bind(&ImporterHost::OnGoogleGAIACookieChecked, this), profile_);
is_source_readable_ = false;
@@ -186,8 +186,8 @@ void ImporterHost::CheckForFirefoxLock(
const importer::SourceProfile& source_profile,
uint16 items,
bool first_run) {
- if (source_profile.importer_type == importer::FIREFOX2 ||
- source_profile.importer_type == importer::FIREFOX3) {
+ if (source_profile.importer_type == importer::TYPE_FIREFOX2 ||
+ source_profile.importer_type == importer::TYPE_FIREFOX3) {
DCHECK(!firefox_lock_.get());
firefox_lock_.reset(new FirefoxProfileLock(source_profile.source_path));
if (!firefox_lock_->HasAcquired()) {
diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc
index 554094b..6d52c82 100644
--- a/chrome/browser/importer/importer_list.cc
+++ b/chrome/browser/importer/importer_list.cc
@@ -6,8 +6,8 @@
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/importer/firefox_importer_utils.h"
-#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/importer/importer_bridge.h"
+#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/shell_integration.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -24,9 +24,9 @@ namespace {
#if defined(OS_WIN)
void DetectIEProfiles(std::vector<importer::SourceProfile*>* profiles) {
// IE always exists and doesn't have multiple profiles.
- importer::SourceProfile* ie = new importer::SourceProfile();
+ importer::SourceProfile* ie = new importer::SourceProfile;
ie->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_IE);
- ie->importer_type = importer::MS_IE;
+ ie->importer_type = importer::TYPE_IE;
ie->source_path.clear();
ie->app_path.clear();
ie->services_supported = importer::HISTORY | importer::FAVORITES |
@@ -41,9 +41,9 @@ void DetectSafariProfiles(std::vector<importer::SourceProfile*>* profiles) {
if (!SafariImporter::CanImport(base::mac::GetUserLibraryPath(), &items))
return;
- importer::SourceProfile* safari = new importer::SourceProfile();
+ importer::SourceProfile* safari = new importer::SourceProfile;
safari->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI);
- safari->importer_type = importer::SAFARI;
+ safari->importer_type = importer::TYPE_SAFARI;
safari->source_path.clear();
safari->app_path.clear();
safari->services_supported = items;
@@ -67,15 +67,15 @@ void DetectFirefoxProfiles(std::vector<importer::SourceProfile*>* profiles) {
GetFirefoxVersionAndPathFromProfile(profile_path, &version, &app_path);
if (version == 2) {
- firefox_type = importer::FIREFOX2;
+ firefox_type = importer::TYPE_FIREFOX2;
} else if (version >= 3) {
- firefox_type = importer::FIREFOX3;
+ firefox_type = importer::TYPE_FIREFOX3;
} else {
// Ignores other versions of firefox.
return;
}
- importer::SourceProfile* firefox = new importer::SourceProfile();
+ importer::SourceProfile* firefox = new importer::SourceProfile;
firefox->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX);
firefox->importer_type = firefox_type;
firefox->source_path = profile_path;
@@ -94,10 +94,10 @@ void DetectGoogleToolbarProfiles(
if (FirstRun::IsChromeFirstRun())
return;
- importer::SourceProfile* google_toolbar = new importer::SourceProfile();
+ importer::SourceProfile* google_toolbar = new importer::SourceProfile;
google_toolbar->importer_name =
l10n_util::GetStringUTF16(IDS_IMPORT_FROM_GOOGLE_TOOLBAR);
- google_toolbar->importer_type = importer::GOOGLE_TOOLBAR5;
+ google_toolbar->importer_type = importer::TYPE_GOOGLE_TOOLBAR5;
google_toolbar->source_path.clear();
google_toolbar->app_path.clear();
google_toolbar->services_supported = importer::FAVORITES;
@@ -153,7 +153,7 @@ const importer::SourceProfile& ImporterList::GetSourceProfileForImporterType(
return *source_profiles_[i];
}
NOTREACHED();
- return *(new importer::SourceProfile());
+ return *(new importer::SourceProfile);
}
void ImporterList::DetectSourceProfilesWorker() {
diff --git a/chrome/browser/importer/importer_type.cc b/chrome/browser/importer/importer_type.cc
index 7e4479b..2d15fc4 100644
--- a/chrome/browser/importer/importer_type.cc
+++ b/chrome/browser/importer/importer_type.cc
@@ -24,21 +24,21 @@ namespace importer {
Importer* CreateImporterByType(ImporterType type) {
switch (type) {
#if defined(OS_WIN)
- case MS_IE:
+ case TYPE_IE:
return new IEImporter();
#endif
- case BOOKMARKS_HTML:
- case FIREFOX2:
+ case TYPE_BOOKMARKS_FILE:
+ case TYPE_FIREFOX2:
return new Firefox2Importer();
- case FIREFOX3:
+ case TYPE_FIREFOX3:
return new Firefox3Importer();
- case GOOGLE_TOOLBAR5:
- return new Toolbar5Importer();
#if defined(OS_MACOSX)
- case SAFARI:
+ case TYPE_SAFARI:
return new SafariImporter(base::mac::GetUserLibraryPath());
-#endif // OS_MACOSX
- case NONE_IMPORTER:
+#endif
+ case TYPE_GOOGLE_TOOLBAR5:
+ return new Toolbar5Importer();
+ default:
NOTREACHED();
return NULL;
}
diff --git a/chrome/browser/importer/importer_type.h b/chrome/browser/importer/importer_type.h
index 0f764b5..89c6f68 100644
--- a/chrome/browser/importer/importer_type.h
+++ b/chrome/browser/importer/importer_type.h
@@ -17,18 +17,18 @@ namespace importer {
// NOTE: Numbers added so that data can be reliably cast to ints and passed
// across IPC.
enum ImporterType {
- NONE_IMPORTER = -1,
+ TYPE_UNKNOWN = -1,
#if defined(OS_WIN)
- MS_IE = 0,
+ TYPE_IE = 0,
#endif
- FIREFOX2 = 1,
- FIREFOX3 = 2, // Firefox 3 and later.
+ TYPE_FIREFOX2 = 1,
+ TYPE_FIREFOX3 = 2, // Firefox 3 and later.
#if defined(OS_MACOSX)
- SAFARI = 3,
+ TYPE_SAFARI = 3,
#endif
- GOOGLE_TOOLBAR5 = 4,
+ TYPE_GOOGLE_TOOLBAR5 = 4,
// Identifies a 'bookmarks.html' file.
- BOOKMARKS_HTML = 5
+ TYPE_BOOKMARKS_FILE = 5
};
Importer* CreateImporterByType(ImporterType type);
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc
index 8c002e3..7404131 100644
--- a/chrome/browser/importer/importer_unittest.cc
+++ b/chrome/browser/importer/importer_unittest.cc
@@ -104,7 +104,7 @@ class ImporterTest : public testing::Test {
MessageLoop* loop = MessageLoop::current();
importer::SourceProfile source_profile;
- source_profile.importer_type = importer::FIREFOX3;
+ source_profile.importer_type = importer::TYPE_FIREFOX3;
source_profile.app_path = app_path_;
source_profile.source_path = profile_path_;
scoped_refptr<ImporterHost> host(new ImporterHost);
@@ -397,7 +397,7 @@ TEST_F(ImporterTest, IEImporter) {
TestObserver* observer = new TestObserver();
host->SetObserver(observer);
importer::SourceProfile source_profile;
- source_profile.importer_type = importer::MS_IE;
+ source_profile.importer_type = importer::TYPE_IE;
source_profile.source_path = temp_dir_.path();
loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(),
@@ -690,7 +690,7 @@ TEST_F(ImporterTest, MAYBE(Firefox2Importer)) {
FirefoxObserver* observer = new FirefoxObserver();
host->SetObserver(observer);
importer::SourceProfile source_profile;
- source_profile.importer_type = importer::FIREFOX2;
+ source_profile.importer_type = importer::TYPE_FIREFOX2;
source_profile.app_path = app_path_;
source_profile.source_path = profile_path_;