OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 int count = GetAvailableProfileCount(); | 190 int count = GetAvailableProfileCount(); |
191 for (int i = 0; i < count; ++i) { | 191 for (int i = 0; i < count; ++i) { |
192 if (source_profiles_[i]->browser_type == browser_type) | 192 if (source_profiles_[i]->browser_type == browser_type) |
193 return *source_profiles_[i]; | 193 return *source_profiles_[i]; |
194 } | 194 } |
195 NOTREACHED(); | 195 NOTREACHED(); |
196 return *(new importer::ProfileInfo()); | 196 return *(new importer::ProfileInfo()); |
197 } | 197 } |
198 | 198 |
| 199 bool ImporterList::source_profiles_loaded() const { |
| 200 return source_profiles_loaded_; |
| 201 } |
| 202 |
199 void ImporterList::DetectSourceProfilesWorker() { | 203 void ImporterList::DetectSourceProfilesWorker() { |
200 // TODO(jhawkins): Remove this condition once DetectSourceProfileHack is | 204 // TODO(jhawkins): Remove this condition once DetectSourceProfileHack is |
201 // removed. |observer_| is NULL when said method is called. | 205 // removed. |observer_| is NULL when said method is called. |
202 if (observer_) | 206 if (observer_) |
203 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 207 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
204 | 208 |
205 std::vector<importer::ProfileInfo*> profiles; | 209 std::vector<importer::ProfileInfo*> profiles; |
206 | 210 |
207 // The first run import will automatically take settings from the first | 211 // The first run import will automatically take settings from the first |
208 // profile detected, which should be the user's current default. | 212 // profile detected, which should be the user's current default. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 BrowserThread::ID current_thread_id; | 252 BrowserThread::ID current_thread_id; |
249 BrowserThread::GetCurrentThreadIdentifier(¤t_thread_id); | 253 BrowserThread::GetCurrentThreadIdentifier(¤t_thread_id); |
250 DCHECK_EQ(current_thread_id, source_thread_id_); | 254 DCHECK_EQ(current_thread_id, source_thread_id_); |
251 | 255 |
252 source_profiles_->assign(profiles.begin(), profiles.end()); | 256 source_profiles_->assign(profiles.begin(), profiles.end()); |
253 source_profiles_loaded_ = true; | 257 source_profiles_loaded_ = true; |
254 observer_->SourceProfilesLoaded(); | 258 observer_->SourceProfilesLoaded(); |
255 observer_ = NULL; | 259 observer_ = NULL; |
256 source_thread_id_ = BrowserThread::UI; | 260 source_thread_id_ = BrowserThread::UI; |
257 } | 261 } |
OLD | NEW |