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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 uint16_t imported_items) { | 86 uint16_t imported_items) { |
87 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 87 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
88 | 88 |
89 if (!imported_items) | 89 if (!imported_items) |
90 return; | 90 return; |
91 | 91 |
92 // If another import is already ongoing, let it finish silently. | 92 // If another import is already ongoing, let it finish silently. |
93 if (importer_host_) | 93 if (importer_host_) |
94 importer_host_->set_observer(NULL); | 94 importer_host_->set_observer(NULL); |
95 | 95 |
96 CallJavascriptFunction("cr.webUIListenerCallback", | 96 FireWebUIListener("import-data-status-changed", |
97 base::Value("import-data-status-changed"), | 97 base::Value(kImportStatusInProgress)); |
98 base::Value(kImportStatusInProgress)); | |
99 import_did_succeed_ = false; | 98 import_did_succeed_ = false; |
100 | 99 |
101 importer_host_ = new ExternalProcessImporterHost(); | 100 importer_host_ = new ExternalProcessImporterHost(); |
102 importer_host_->set_observer(this); | 101 importer_host_->set_observer(this); |
103 Profile* profile = Profile::FromWebUI(web_ui()); | 102 Profile* profile = Profile::FromWebUI(web_ui()); |
104 importer_host_->StartImportSettings(source_profile, profile, | 103 importer_host_->StartImportSettings(source_profile, profile, |
105 imported_items, | 104 imported_items, |
106 new ProfileWriter(profile)); | 105 new ProfileWriter(profile)); |
107 | 106 |
108 importer::LogImporterUseToMetrics("ImportDataHandler", | 107 importer::LogImporterUseToMetrics("ImportDataHandler", |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 base::string16(), | 246 base::string16(), |
248 base::FilePath(), | 247 base::FilePath(), |
249 &file_type_info, | 248 &file_type_info, |
250 0, | 249 0, |
251 base::FilePath::StringType(), | 250 base::FilePath::StringType(), |
252 browser->window()->GetNativeWindow(), | 251 browser->window()->GetNativeWindow(), |
253 NULL); | 252 NULL); |
254 } | 253 } |
255 | 254 |
256 } // namespace settings | 255 } // namespace settings |
OLD | NEW |