| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/importer/importer_list.h" | 5 #include "chrome/browser/importer/importer_list.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/importer/firefox_importer_utils.h" | |
| 9 #include "chrome/browser/importer/importer_bridge.h" | |
| 10 #include "chrome/browser/importer/importer_list_observer.h" | 8 #include "chrome/browser/importer/importer_list_observer.h" |
| 11 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
| 10 #include "chrome/common/importer/firefox_importer_utils.h" |
| 11 #include "chrome/common/importer/importer_bridge.h" |
| 12 #include "chrome/common/importer/importer_data_types.h" | 12 #include "chrome/common/importer/importer_data_types.h" |
| 13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 | 15 |
| 16 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
| 17 #include <CoreFoundation/CoreFoundation.h> | 17 #include <CoreFoundation/CoreFoundation.h> |
| 18 | 18 |
| 19 #include "base/mac/foundation_util.h" | 19 #include "base/mac/foundation_util.h" |
| 20 #include "chrome/browser/importer/safari_importer.h" | 20 #include "chrome/utility/importer/safari_importer.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 using content::BrowserThread; | 23 using content::BrowserThread; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 28 void DetectIEProfiles(std::vector<importer::SourceProfile*>* profiles) { | 28 void DetectIEProfiles(std::vector<importer::SourceProfile*>* profiles) { |
| 29 // IE always exists and doesn't have multiple profiles. | 29 // IE always exists and doesn't have multiple profiles. |
| 30 importer::SourceProfile* ie = new importer::SourceProfile; | 30 importer::SourceProfile* ie = new importer::SourceProfile; |
| 31 ie->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_IE); | 31 ie->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_IE); |
| 32 ie->importer_type = importer::TYPE_IE; | 32 ie->importer_type = importer::TYPE_IE; |
| 33 ie->source_path.clear(); | 33 ie->source_path.clear(); |
| 34 ie->app_path.clear(); | 34 ie->app_path.clear(); |
| 35 ie->services_supported = importer::HISTORY | importer::FAVORITES | | 35 ie->services_supported = importer::HISTORY | importer::FAVORITES | |
| 36 importer::COOKIES | importer::PASSWORDS | importer::SEARCH_ENGINES; | 36 importer::COOKIES | importer::PASSWORDS | importer::SEARCH_ENGINES; |
| 37 profiles->push_back(ie); | 37 profiles->push_back(ie); |
| 38 } | 38 } |
| 39 #endif // defined(OS_WIN) | 39 #endif // defined(OS_WIN) |
| 40 | 40 |
| 41 #if defined(OS_MACOSX) | 41 #if defined(OS_MACOSX) |
| 42 void DetectSafariProfiles(std::vector<importer::SourceProfile*>* profiles) { | 42 void DetectSafariProfiles(std::vector<importer::SourceProfile*>* profiles) { |
| 43 uint16 items = importer::NONE; | 43 uint16 items = importer::NONE; |
| 44 if (!SafariImporter::CanImport(base::mac::GetUserLibraryPath(), &items)) | 44 if (!SafariImporterCanImport(base::mac::GetUserLibraryPath(), &items)) |
| 45 return; | 45 return; |
| 46 | 46 |
| 47 importer::SourceProfile* safari = new importer::SourceProfile; | 47 importer::SourceProfile* safari = new importer::SourceProfile; |
| 48 safari->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI); | 48 safari->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI); |
| 49 safari->importer_type = importer::TYPE_SAFARI; | 49 safari->importer_type = importer::TYPE_SAFARI; |
| 50 safari->source_path.clear(); | 50 safari->source_path.clear(); |
| 51 safari->app_path.clear(); | 51 safari->app_path.clear(); |
| 52 safari->services_supported = items; | 52 safari->services_supported = items; |
| 53 profiles->push_back(safari); | 53 profiles->push_back(safari); |
| 54 } | 54 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 source_profiles_.assign(profiles.begin(), profiles.end()); | 202 source_profiles_.assign(profiles.begin(), profiles.end()); |
| 203 source_profiles_loaded_ = true; | 203 source_profiles_loaded_ = true; |
| 204 source_thread_id_ = BrowserThread::UI; | 204 source_thread_id_ = BrowserThread::UI; |
| 205 | 205 |
| 206 observer_->OnSourceProfilesLoaded(); | 206 observer_->OnSourceProfilesLoaded(); |
| 207 observer_ = NULL; | 207 observer_ = NULL; |
| 208 | 208 |
| 209 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. | 209 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. |
| 210 is_observed_ = false; | 210 is_observed_ = false; |
| 211 } | 211 } |
| OLD | NEW |