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 <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "build/build_config.h" |
8 #include "chrome/browser/shell_integration.h" | 11 #include "chrome/browser/shell_integration.h" |
9 #include "chrome/common/importer/firefox_importer_utils.h" | 12 #include "chrome/common/importer/firefox_importer_utils.h" |
10 #include "chrome/common/importer/importer_bridge.h" | 13 #include "chrome/common/importer/importer_bridge.h" |
11 #include "chrome/common/importer/importer_data_types.h" | 14 #include "chrome/common/importer/importer_data_types.h" |
12 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
13 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
14 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
15 | 18 |
16 #if defined(OS_MACOSX) | 19 #if defined(OS_MACOSX) |
17 #include <CoreFoundation/CoreFoundation.h> | 20 #include <CoreFoundation/CoreFoundation.h> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (importer::EdgeImporterCanImport()) | 59 if (importer::EdgeImporterCanImport()) |
57 DetectEdgeProfiles(profiles); | 60 DetectEdgeProfiles(profiles); |
58 DetectIEProfiles(profiles); | 61 DetectIEProfiles(profiles); |
59 } | 62 } |
60 | 63 |
61 #endif // defined(OS_WIN) | 64 #endif // defined(OS_WIN) |
62 | 65 |
63 #if defined(OS_MACOSX) | 66 #if defined(OS_MACOSX) |
64 void DetectSafariProfiles(std::vector<importer::SourceProfile>* profiles) { | 67 void DetectSafariProfiles(std::vector<importer::SourceProfile>* profiles) { |
65 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 68 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
66 uint16 items = importer::NONE; | 69 uint16_t items = importer::NONE; |
67 if (!SafariImporterCanImport(base::mac::GetUserLibraryPath(), &items)) | 70 if (!SafariImporterCanImport(base::mac::GetUserLibraryPath(), &items)) |
68 return; | 71 return; |
69 | 72 |
70 importer::SourceProfile safari; | 73 importer::SourceProfile safari; |
71 safari.importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI); | 74 safari.importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI); |
72 safari.importer_type = importer::TYPE_SAFARI; | 75 safari.importer_type = importer::TYPE_SAFARI; |
73 safari.services_supported = items; | 76 safari.services_supported = items; |
74 profiles->push_back(safari); | 77 profiles->push_back(safari); |
75 } | 78 } |
76 #endif // defined(OS_MACOSX) | 79 #endif // defined(OS_MACOSX) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 195 } |
193 | 196 |
194 void ImporterList::SourceProfilesLoaded( | 197 void ImporterList::SourceProfilesLoaded( |
195 const base::Closure& profiles_loaded_callback, | 198 const base::Closure& profiles_loaded_callback, |
196 const std::vector<importer::SourceProfile>& profiles) { | 199 const std::vector<importer::SourceProfile>& profiles) { |
197 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 200 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
198 | 201 |
199 source_profiles_.assign(profiles.begin(), profiles.end()); | 202 source_profiles_.assign(profiles.begin(), profiles.end()); |
200 profiles_loaded_callback.Run(); | 203 profiles_loaded_callback.Run(); |
201 } | 204 } |
OLD | NEW |