Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: chrome/browser/ui/webui/settings/settings_import_data_handler.cc

Issue 2727813002: Options/MD Settings: use new prefs to drive import data dialog (Closed)
Patch Set: pastarmovj@ review Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698