diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-11 23:45:25 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-11 23:45:25 +0000 |
commit | 1bdf29eb27c00bd1be0a6f3eb65d33ecddde274f (patch) | |
tree | 35abd9143abed93d47d2bd4bf63f922e4d5c99dc /chrome/browser/importer/importer.cc | |
parent | 0c557f15b825d1036a1e48a148ff10d9cd51ab0f (diff) | |
download | chromium_src-1bdf29eb27c00bd1be0a6f3eb65d33ecddde274f.zip chromium_src-1bdf29eb27c00bd1be0a6f3eb65d33ecddde274f.tar.gz chromium_src-1bdf29eb27c00bd1be0a6f3eb65d33ecddde274f.tar.bz2 |
Add import settings dialog on linux.
BUG=11191
TEST=Open Import Settings dialog from Chrome wrench menu on Linux and make sure it imports Firefox data as selected.
Review URL: http://codereview.chromium.org/115133
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer/importer.cc')
-rw-r--r-- | chrome/browser/importer/importer.cc | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index 66aa8ed..2bfb9f6 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -515,7 +515,7 @@ void ImporterHost::StartImportSettings(const ProfileInfo& profile_info, } } - #if defined(OS_WIN) +#if defined(OS_WIN) // For google toolbar import, we need the user to log in and store their GAIA // credentials. if (profile_info.browser_type == GOOGLE_TOOLBAR5) { @@ -677,26 +677,12 @@ void ImporterHost::DetectIEProfiles() { #endif void ImporterHost::DetectFirefoxProfiles() { - // Detects which version of Firefox is installed. - int version = GetCurrentFirefoxMajorVersion(); - ProfileType firefox_type; - if (version == 2) { - firefox_type = FIREFOX2; - } else if (version == 3) { - firefox_type = FIREFOX3; - } else { - // Ignores other versions of firefox. - return; - } - +#if defined(OS_MACOSX) + NOTIMPLEMENTED(); +#else DictionaryValue root; -#if defined(OS_WIN) - std::wstring ini_file = GetProfilesINI(); + std::wstring ini_file = GetProfilesINI().ToWStringHack(); ParseProfileINI(ini_file, &root); -#else - // TODO(port): Do we need to concern ourselves with profiles on posix? - NOTIMPLEMENTED(); -#endif std::wstring source_path; for (int i = 0; ; ++i) { @@ -714,7 +700,6 @@ void ImporterHost::DetectFirefoxProfiles() { &path16, 0, ASCIIToUTF16("/"), ASCIIToUTF16("\\")); path.assign(UTF16ToWideHack(path16)); -#if defined(OS_WIN) // IsRelative=1 means the folder path would be relative to the // path of profiles.ini. IsRelative=0 refers to a custom profile // location. @@ -724,7 +709,6 @@ void ImporterHost::DetectFirefoxProfiles() { } else { profile_path = path; } -#endif // We only import the default profile when multiple profiles exist, // since the other profiles are used mostly by developers for testing. @@ -740,16 +724,34 @@ void ImporterHost::DetectFirefoxProfiles() { } } + // Detects which version of Firefox is installed. + ProfileType firefox_type; + std::wstring app_path; + int version = GetCurrentFirefoxMajorVersion(); + if (version != 2 && version != 3) + GetFirefoxVersionAndPathFromProfile(source_path, &version, &app_path); + if (version == 2) { + firefox_type = FIREFOX2; + } else if (version == 3) { + firefox_type = FIREFOX3; + } else { + // Ignores other versions of firefox. + return; + } + if (!source_path.empty()) { ProfileInfo* firefox = new ProfileInfo(); firefox->description = l10n_util::GetString(IDS_IMPORT_FROM_FIREFOX); firefox->browser_type = firefox_type; firefox->source_path = source_path; firefox->app_path = GetFirefoxInstallPath(); + if (firefox->app_path.empty()) + firefox->app_path = app_path; firefox->services_supported = HISTORY | FAVORITES | COOKIES | PASSWORDS | SEARCH_ENGINES; source_profiles_.push_back(firefox); } +#endif } void ImporterHost::DetectGoogleToolbarProfiles() { |