| 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->services_supported = importer::FAVORITES; |
| 183 profiles.push_back(bookmarks_file); |
| 178 | 184 |
| 179 // TODO(jhawkins): Remove this condition once DetectSourceProfilesHack is | 185 // TODO(jhawkins): Remove this condition once DetectSourceProfilesHack is |
| 180 // removed. | 186 // removed. |
| 181 if (is_observed_) { | 187 if (is_observed_) { |
| 182 BrowserThread::PostTask( | 188 BrowserThread::PostTask( |
| 183 source_thread_id_, | 189 source_thread_id_, |
| 184 FROM_HERE, | 190 FROM_HERE, |
| 185 base::Bind(&ImporterList::SourceProfilesLoaded, this, profiles)); | 191 base::Bind(&ImporterList::SourceProfilesLoaded, this, profiles)); |
| 186 } else { | 192 } else { |
| 187 source_profiles_.assign(profiles.begin(), profiles.end()); | 193 source_profiles_.assign(profiles.begin(), profiles.end()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 202 source_profiles_.assign(profiles.begin(), profiles.end()); | 208 source_profiles_.assign(profiles.begin(), profiles.end()); |
| 203 source_profiles_loaded_ = true; | 209 source_profiles_loaded_ = true; |
| 204 source_thread_id_ = BrowserThread::UI; | 210 source_thread_id_ = BrowserThread::UI; |
| 205 | 211 |
| 206 observer_->OnSourceProfilesLoaded(); | 212 observer_->OnSourceProfilesLoaded(); |
| 207 observer_ = NULL; | 213 observer_ = NULL; |
| 208 | 214 |
| 209 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. | 215 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. |
| 210 is_observed_ = false; | 216 is_observed_ = false; |
| 211 } | 217 } |
| OLD | NEW |