| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/settings/settings_import_data_handler.h" | 5 #include "chrome/browser/ui/webui/settings/settings_import_data_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 void ImportDataHandler::ImportData(const base::ListValue* args) { | 112 void ImportDataHandler::ImportData(const base::ListValue* args) { |
| 113 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 113 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 114 | 114 |
| 115 int browser_index; | 115 int browser_index; |
| 116 CHECK(args->GetInteger(0, &browser_index)); | 116 CHECK(args->GetInteger(0, &browser_index)); |
| 117 | 117 |
| 118 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 118 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 119 | 119 |
| 120 uint16_t selected_items = importer::NONE; | 120 uint16_t selected_items = importer::NONE; |
| 121 if (prefs->GetBoolean(prefs::kImportAutofillFormData)) | 121 if (prefs->GetBoolean(prefs::kImportDialogAutofillFormData)) |
| 122 selected_items |= importer::AUTOFILL_FORM_DATA; | 122 selected_items |= importer::AUTOFILL_FORM_DATA; |
| 123 if (prefs->GetBoolean(prefs::kImportBookmarks)) | 123 if (prefs->GetBoolean(prefs::kImportDialogBookmarks)) |
| 124 selected_items |= importer::FAVORITES; | 124 selected_items |= importer::FAVORITES; |
| 125 if (prefs->GetBoolean(prefs::kImportHistory)) | 125 if (prefs->GetBoolean(prefs::kImportDialogHistory)) |
| 126 selected_items |= importer::HISTORY; | 126 selected_items |= importer::HISTORY; |
| 127 if (prefs->GetBoolean(prefs::kImportSavedPasswords)) | 127 if (prefs->GetBoolean(prefs::kImportDialogSavedPasswords)) |
| 128 selected_items |= importer::PASSWORDS; | 128 selected_items |= importer::PASSWORDS; |
| 129 if (prefs->GetBoolean(prefs::kImportSearchEngine)) | 129 if (prefs->GetBoolean(prefs::kImportDialogSearchEngine)) |
| 130 selected_items |= importer::SEARCH_ENGINES; | 130 selected_items |= importer::SEARCH_ENGINES; |
| 131 | 131 |
| 132 const importer::SourceProfile& source_profile = | 132 const importer::SourceProfile& source_profile = |
| 133 importer_list_->GetSourceProfileAt(browser_index); | 133 importer_list_->GetSourceProfileAt(browser_index); |
| 134 uint16_t supported_items = source_profile.services_supported; | 134 uint16_t supported_items = source_profile.services_supported; |
| 135 | 135 |
| 136 uint16_t imported_items = (selected_items & supported_items); | 136 uint16_t imported_items = (selected_items & supported_items); |
| 137 if (imported_items) { | 137 if (imported_items) { |
| 138 StartImport(source_profile, imported_items); | 138 StartImport(source_profile, imported_items); |
| 139 } else { | 139 } else { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 base::string16(), | 248 base::string16(), |
| 249 base::FilePath(), | 249 base::FilePath(), |
| 250 &file_type_info, | 250 &file_type_info, |
| 251 0, | 251 0, |
| 252 base::FilePath::StringType(), | 252 base::FilePath::StringType(), |
| 253 browser->window()->GetNativeWindow(), | 253 browser->window()->GetNativeWindow(), |
| 254 NULL); | 254 NULL); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace settings | 257 } // namespace settings |
| OLD | NEW |