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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 importer_list_->GetSourceProfileAt(browser_index); | 101 importer_list_->GetSourceProfileAt(browser_index); |
102 uint16 supported_items = source_profile.services_supported; | 102 uint16 supported_items = source_profile.services_supported; |
103 | 103 |
104 uint16 import_services = (selected_items & supported_items); | 104 uint16 import_services = (selected_items & supported_items); |
105 if (import_services) { | 105 if (import_services) { |
106 base::FundamentalValue state(true); | 106 base::FundamentalValue state(true); |
107 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", | 107 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", |
108 state); | 108 state); |
109 import_did_succeed_ = false; | 109 import_did_succeed_ = false; |
110 | 110 |
111 // TODO(csilv): Out-of-process import has only been qualified on MacOS X, | 111 // TODO(gab): Make Linux use OOP import as well (http://crbug.com/56816) and |
112 // so we will only use it on that platform since it is required. Remove this | 112 // get rid of these ugly ifdefs. |
113 // conditional logic once oop import is qualified for Linux/Windows. | 113 #if defined(OS_MACOSX) || defined(OS_WIN) |
114 // http://crbug.com/22142 | |
115 #if defined(OS_MACOSX) | |
116 importer_host_ = new ExternalProcessImporterHost; | 114 importer_host_ = new ExternalProcessImporterHost; |
117 #else | 115 #else |
118 importer_host_ = new ImporterHost; | 116 importer_host_ = new ImporterHost; |
119 #endif | 117 #endif |
120 importer_host_->SetObserver(this); | 118 importer_host_->SetObserver(this); |
121 importer_host_->set_browser( | 119 importer_host_->set_browser( |
122 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); | 120 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); |
123 Profile* profile = Profile::FromWebUI(web_ui()); | 121 Profile* profile = Profile::FromWebUI(web_ui()); |
124 importer_host_->StartImportSettings(source_profile, profile, | 122 importer_host_->StartImportSettings(source_profile, profile, |
125 import_services, | 123 import_services, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 web_ui()->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); | 181 web_ui()->CallJavascriptFunction("ImportDataOverlay.confirmSuccess"); |
184 } else { | 182 } else { |
185 base::FundamentalValue state(false); | 183 base::FundamentalValue state(false); |
186 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", | 184 web_ui()->CallJavascriptFunction("ImportDataOverlay.setImportingState", |
187 state); | 185 state); |
188 web_ui()->CallJavascriptFunction("ImportDataOverlay.dismiss"); | 186 web_ui()->CallJavascriptFunction("ImportDataOverlay.dismiss"); |
189 } | 187 } |
190 } | 188 } |
191 | 189 |
192 } // namespace options | 190 } // namespace options |
OLD | NEW |