Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/import_data_handler.h" | 5 #include "chrome/browser/ui/webui/options/import_data_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 importer_list_->GetSourceProfileAt(browser_index); | 102 importer_list_->GetSourceProfileAt(browser_index); |
| 103 uint16 supported_items = source_profile.services_supported; | 103 uint16 supported_items = source_profile.services_supported; |
| 104 | 104 |
| 105 uint16 import_services = (selected_items & supported_items); | 105 uint16 import_services = (selected_items & supported_items); |
| 106 if (import_services) { | 106 if (import_services) { |
| 107 base::FundamentalValue state(true); | 107 base::FundamentalValue state(true); |
| 108 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", | 108 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", |
| 109 state); | 109 state); |
| 110 import_did_succeed_ = false; | 110 import_did_succeed_ = false; |
| 111 | 111 |
| 112 // TODO(csilv): Out-of-process import has only been qualified on MacOS X, | 112 // TODO(gab): Make Linux use OOP import as well (http://crbug.com/56816) and |
| 113 // so we will only use it on that platform since it is required. Remove this | 113 // get rid of these ugly ifdefs. |
| 114 // conditional logic once oop import is qualified for Linux/Windows. | 114 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 115 // http://crbug.com/22142 | 115 // The Google Toolbar import doesn't work for the out-of-process import. |
|
Nico
2013/04/29 03:24:54
Maybe call out that Google Toolbar import never ru
gab
2013/04/29 12:41:53
Done.
| |
| 116 #if defined(OS_MACOSX) | 116 // See discussion on http://crbug.com/219419 for details. |
| 117 importer_host_ = new ExternalProcessImporterHost; | 117 if (source_profile.importer_type == importer::TYPE_GOOGLE_TOOLBAR5) |
| 118 importer_host_ = new ImporterHost; | |
| 119 else | |
| 120 importer_host_ = new ExternalProcessImporterHost; | |
| 118 #else | 121 #else |
| 119 importer_host_ = new ImporterHost; | 122 importer_host_ = new ImporterHost; |
| 120 #endif | 123 #endif |
| 121 importer_host_->SetObserver(this); | 124 importer_host_->SetObserver(this); |
| 122 importer_host_->set_browser( | 125 importer_host_->set_browser( |
| 123 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); | 126 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); |
| 124 Profile* profile = Profile::FromWebUI(web_ui()); | 127 Profile* profile = Profile::FromWebUI(web_ui()); |
| 125 importer_host_->StartImportSettings(source_profile, profile, | 128 importer_host_->StartImportSettings(source_profile, profile, |
| 126 import_services, | 129 import_services, |
| 127 new ProfileWriter(profile)); | 130 new ProfileWriter(profile)); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 web_ui()->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); | 190 web_ui()->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); |
| 188 } else { | 191 } else { |
| 189 base::FundamentalValue state(false); | 192 base::FundamentalValue state(false); |
| 190 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", | 193 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", |
| 191 state); | 194 state); |
| 192 web_ui()->CallJavascriptFunction("ImportDataOverlay.dismiss"); | 195 web_ui()->CallJavascriptFunction("ImportDataOverlay.dismiss"); |
| 193 } | 196 } |
| 194 } | 197 } |
| 195 | 198 |
| 196 } // namespace options | 199 } // namespace options |
| OLD | NEW |