OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #endif | 28 #endif |
29 | 29 |
30 ImporterList::ImporterList() { | 30 ImporterList::ImporterList() { |
31 } | 31 } |
32 | 32 |
33 ImporterList::~ImporterList() { | 33 ImporterList::~ImporterList() { |
34 STLDeleteContainerPointers(source_profiles_.begin(), source_profiles_.end()); | 34 STLDeleteContainerPointers(source_profiles_.begin(), source_profiles_.end()); |
35 } | 35 } |
36 | 36 |
37 void ImporterList::DetectSourceProfiles() { | 37 void ImporterList::DetectSourceProfiles() { |
| 38 // The first run import will automatically take settings from the first |
| 39 // profile detected, which should be the user's current default. |
38 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
39 // The order in which detect is called determines the order | |
40 // in which the options appear in the dropdown combo-box | |
41 if (ShellIntegration::IsFirefoxDefaultBrowser()) { | 41 if (ShellIntegration::IsFirefoxDefaultBrowser()) { |
42 DetectFirefoxProfiles(); | 42 DetectFirefoxProfiles(); |
43 DetectIEProfiles(); | 43 DetectIEProfiles(); |
44 } else { | 44 } else { |
45 DetectIEProfiles(); | 45 DetectIEProfiles(); |
46 DetectFirefoxProfiles(); | 46 DetectFirefoxProfiles(); |
47 } | 47 } |
48 // TODO(brg) : Current UI requires win_util. | 48 // TODO(brg) : Current UI requires win_util. |
49 DetectGoogleToolbarProfiles(); | 49 DetectGoogleToolbarProfiles(); |
| 50 #elif defined(OS_MACOSX) |
| 51 if (ShellIntegration::IsFirefoxDefaultBrowser()) { |
| 52 DetectFirefoxProfiles(); |
| 53 DetectSafariProfiles(); |
| 54 } else { |
| 55 DetectSafariProfiles(); |
| 56 DetectFirefoxProfiles(); |
| 57 } |
50 #else | 58 #else |
51 #if defined(OS_MACOSX) | |
52 DetectSafariProfiles(); | |
53 #endif | |
54 DetectFirefoxProfiles(); | 59 DetectFirefoxProfiles(); |
55 #endif | 60 #endif |
56 } | 61 } |
57 | 62 |
58 Importer* ImporterList::CreateImporterByType(importer::ProfileType type) { | 63 Importer* ImporterList::CreateImporterByType(importer::ProfileType type) { |
59 switch (type) { | 64 switch (type) { |
60 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
61 case importer::MS_IE: | 66 case importer::MS_IE: |
62 return new IEImporter(); | 67 return new IEImporter(); |
63 #endif | 68 #endif |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 importer::ProfileInfo* safari = new importer::ProfileInfo(); | 184 importer::ProfileInfo* safari = new importer::ProfileInfo(); |
180 safari->browser_type = importer::SAFARI; | 185 safari->browser_type = importer::SAFARI; |
181 safari->description = l10n_util::GetString(IDS_IMPORT_FROM_SAFARI); | 186 safari->description = l10n_util::GetString(IDS_IMPORT_FROM_SAFARI); |
182 safari->source_path.clear(); | 187 safari->source_path.clear(); |
183 safari->app_path.clear(); | 188 safari->app_path.clear(); |
184 safari->services_supported = items; | 189 safari->services_supported = items; |
185 source_profiles_.push_back(safari); | 190 source_profiles_.push_back(safari); |
186 } | 191 } |
187 } | 192 } |
188 #endif // OS_MACOSX | 193 #endif // OS_MACOSX |
OLD | NEW |