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 #import "chrome/browser/cocoa/import_settings_dialog.h" | 5 #import "chrome/browser/cocoa/import_settings_dialog.h" |
6 | 6 |
7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/importer/importer_data_types.h" | 9 #include "chrome/browser/importer/importer_data_types.h" |
10 #include "chrome/browser/importer/importer_list.h" | 10 #include "chrome/browser/importer/importer_list.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 - (IBAction)ok:(id)sender { | 172 - (IBAction)ok:(id)sender { |
173 [self closeDialog]; | 173 [self closeDialog]; |
174 const importer::ProfileInfo& sourceProfile = | 174 const importer::ProfileInfo& sourceProfile = |
175 importerList_.get()->GetSourceProfileInfoAt([self sourceBrowserIndex]); | 175 importerList_.get()->GetSourceProfileInfoAt([self sourceBrowserIndex]); |
176 uint16 items = sourceProfile.services_supported; | 176 uint16 items = sourceProfile.services_supported; |
177 // ProfileInfo.services_supported is a uint16 while the call to | 177 // ProfileInfo.services_supported is a uint16 while the call to |
178 // StartImportingWithUI requires an int16. | 178 // StartImportingWithUI requires an int16. |
179 int16 servicesToImport = static_cast<int16>(items & [self servicesToImport]); | 179 int16 servicesToImport = static_cast<int16>(items & [self servicesToImport]); |
180 if (servicesToImport) { | 180 if (servicesToImport) { |
181 if (profile_) { | 181 if (profile_) { |
182 ImporterHost* importerHost = new ImporterHost; | 182 ImporterHost* importerHost = new ExternalProcessImporterHost; |
183 // Note that a side effect of the following call is to cause the | 183 // Note that a side effect of the following call is to cause the |
184 // importerHost to be disposed once the import has completed. | 184 // importerHost to be disposed once the import has completed. |
185 StartImportingWithUI(nil, servicesToImport, importerHost, | 185 StartImportingWithUI(nil, servicesToImport, importerHost, |
186 sourceProfile, profile_, nil, false); | 186 sourceProfile, profile_, nil, false); |
187 } | 187 } |
188 } else { | 188 } else { |
189 LOG(WARNING) << "There were no settings to import from '" | 189 LOG(WARNING) << "There were no settings to import from '" |
190 << sourceProfile.description << "'."; | 190 << sourceProfile.description << "'."; |
191 } | 191 } |
192 } | 192 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 // KVO accessor which returns YES if at least one of the services | 239 // KVO accessor which returns YES if at least one of the services |
240 // provided by the selected profile has been marked for importing | 240 // provided by the selected profile has been marked for importing |
241 // and bound to the OK button's enable property. | 241 // and bound to the OK button's enable property. |
242 - (BOOL)importSomething { | 242 - (BOOL)importSomething { |
243 return [self importHistory] || [self importFavorites] || | 243 return [self importHistory] || [self importFavorites] || |
244 [self importPasswords] || [self importSearchEngines]; | 244 [self importPasswords] || [self importSearchEngines]; |
245 } | 245 } |
246 | 246 |
247 @end | 247 @end |
OLD | NEW |