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/importer/importer_list.h" | 5 #include "chrome/browser/importer/importer_list.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/importer/importer_list_observer.h" | 8 #include "chrome/browser/importer/importer_list_observer.h" |
| 9 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
| 10 #include "chrome/common/importer/firefox_importer_utils.h" | 10 #include "chrome/common/importer/firefox_importer_utils.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 if (ShellIntegration::IsFirefoxDefaultBrowser()) { | 168 if (ShellIntegration::IsFirefoxDefaultBrowser()) { |
| 169 DetectFirefoxProfiles(locale, &profiles); | 169 DetectFirefoxProfiles(locale, &profiles); |
| 170 DetectSafariProfiles(&profiles); | 170 DetectSafariProfiles(&profiles); |
| 171 } else { | 171 } else { |
| 172 DetectSafariProfiles(&profiles); | 172 DetectSafariProfiles(&profiles); |
| 173 DetectFirefoxProfiles(locale, &profiles); | 173 DetectFirefoxProfiles(locale, &profiles); |
| 174 } | 174 } |
| 175 #else | 175 #else |
| 176 DetectFirefoxProfiles(locale, &profiles); | 176 DetectFirefoxProfiles(locale, &profiles); |
| 177 #endif | 177 #endif |
| 178 importer::SourceProfile* bookmarks_file = new importer::SourceProfile; | |
| 179 bookmarks_file->importer_name = | |
| 180 l10n_util::GetStringUTF16(IDS_IMPORT_FROM_BOOKMARKS_HTML_FILE); | |
| 181 bookmarks_file->importer_type = importer::TYPE_BOOKMARKS_FILE; | |
| 182 bookmarks_file->source_path.clear(); | |
| 183 bookmarks_file->app_path.clear(); | |
|
Ilya Sherman
2013/08/08 08:09:28
nit: These shouldn't be needed, as they ought to h
tfarina
2013/08/10 15:05:39
Done.
| |
| 184 bookmarks_file->services_supported = importer::FAVORITES; | |
| 185 profiles.push_back(bookmarks_file); | |
| 178 | 186 |
| 179 // TODO(jhawkins): Remove this condition once DetectSourceProfilesHack is | 187 // TODO(jhawkins): Remove this condition once DetectSourceProfilesHack is |
| 180 // removed. | 188 // removed. |
| 181 if (is_observed_) { | 189 if (is_observed_) { |
| 182 BrowserThread::PostTask( | 190 BrowserThread::PostTask( |
| 183 source_thread_id_, | 191 source_thread_id_, |
| 184 FROM_HERE, | 192 FROM_HERE, |
| 185 base::Bind(&ImporterList::SourceProfilesLoaded, this, profiles)); | 193 base::Bind(&ImporterList::SourceProfilesLoaded, this, profiles)); |
| 186 } else { | 194 } else { |
| 187 source_profiles_.assign(profiles.begin(), profiles.end()); | 195 source_profiles_.assign(profiles.begin(), profiles.end()); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 202 source_profiles_.assign(profiles.begin(), profiles.end()); | 210 source_profiles_.assign(profiles.begin(), profiles.end()); |
| 203 source_profiles_loaded_ = true; | 211 source_profiles_loaded_ = true; |
| 204 source_thread_id_ = BrowserThread::UI; | 212 source_thread_id_ = BrowserThread::UI; |
| 205 | 213 |
| 206 observer_->OnSourceProfilesLoaded(); | 214 observer_->OnSourceProfilesLoaded(); |
| 207 observer_ = NULL; | 215 observer_ = NULL; |
| 208 | 216 |
| 209 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. | 217 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. |
| 210 is_observed_ = false; | 218 is_observed_ = false; |
| 211 } | 219 } |
| OLD | NEW |