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/first_run/first_run.h" | 8 #include "chrome/browser/first_run/first_run.h" |
9 #include "chrome/browser/importer/firefox_importer_utils.h" | 9 #include "chrome/browser/importer/firefox_importer_utils.h" |
10 #include "chrome/browser/importer/importer_bridge.h" | 10 #include "chrome/browser/importer/importer_bridge.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
87 firefox->app_path = GetFirefoxInstallPathFromRegistry(); | 87 firefox->app_path = GetFirefoxInstallPathFromRegistry(); |
88 #endif | 88 #endif |
89 if (firefox->app_path.empty()) | 89 if (firefox->app_path.empty()) |
90 firefox->app_path = app_path; | 90 firefox->app_path = app_path; |
91 firefox->services_supported = importer::HISTORY | importer::FAVORITES | | 91 firefox->services_supported = importer::HISTORY | importer::FAVORITES | |
92 importer::PASSWORDS | importer::SEARCH_ENGINES; | 92 importer::PASSWORDS | importer::SEARCH_ENGINES; |
93 profiles->push_back(firefox); | 93 profiles->push_back(firefox); |
94 } | 94 } |
95 | 95 |
| 96 #if defined(OS_WIN) |
96 void DetectGoogleToolbarProfiles( | 97 void DetectGoogleToolbarProfiles( |
97 std::vector<importer::SourceProfile*>* profiles, | 98 std::vector<importer::SourceProfile*>* profiles, |
98 scoped_refptr<net::URLRequestContextGetter> request_context_getter) { | 99 scoped_refptr<net::URLRequestContextGetter> request_context_getter) { |
99 if (first_run::IsChromeFirstRun()) | 100 if (first_run::IsChromeFirstRun()) |
100 return; | 101 return; |
101 | 102 |
102 importer::SourceProfile* google_toolbar = new importer::SourceProfile; | 103 importer::SourceProfile* google_toolbar = new importer::SourceProfile; |
103 google_toolbar->importer_name = | 104 google_toolbar->importer_name = |
104 l10n_util::GetStringUTF16(IDS_IMPORT_FROM_GOOGLE_TOOLBAR); | 105 l10n_util::GetStringUTF16(IDS_IMPORT_FROM_GOOGLE_TOOLBAR); |
105 google_toolbar->importer_type = importer::TYPE_GOOGLE_TOOLBAR5; | 106 google_toolbar->importer_type = importer::TYPE_GOOGLE_TOOLBAR5; |
106 google_toolbar->source_path.clear(); | 107 google_toolbar->source_path.clear(); |
107 google_toolbar->app_path.clear(); | 108 google_toolbar->app_path.clear(); |
108 google_toolbar->services_supported = importer::FAVORITES; | 109 google_toolbar->services_supported = importer::FAVORITES; |
109 google_toolbar->request_context_getter = request_context_getter; | 110 google_toolbar->request_context_getter = request_context_getter; |
110 profiles->push_back(google_toolbar); | 111 profiles->push_back(google_toolbar); |
111 } | 112 } |
| 113 #endif |
112 | 114 |
113 } // namespace | 115 } // namespace |
114 | 116 |
115 ImporterList::ImporterList( | 117 ImporterList::ImporterList( |
116 net::URLRequestContextGetter* request_context_getter) | 118 net::URLRequestContextGetter* request_context_getter) |
117 : source_thread_id_(BrowserThread::UI), | 119 : source_thread_id_(BrowserThread::UI), |
118 observer_(NULL), | 120 observer_(NULL), |
119 is_observed_(false), | 121 is_observed_(false), |
120 source_profiles_loaded_(false) { | 122 source_profiles_loaded_(false) { |
121 request_context_getter_ = make_scoped_refptr(request_context_getter); | 123 request_context_getter_ = make_scoped_refptr(request_context_getter); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 source_profiles_.assign(profiles.begin(), profiles.end()); | 226 source_profiles_.assign(profiles.begin(), profiles.end()); |
225 source_profiles_loaded_ = true; | 227 source_profiles_loaded_ = true; |
226 source_thread_id_ = BrowserThread::UI; | 228 source_thread_id_ = BrowserThread::UI; |
227 | 229 |
228 observer_->OnSourceProfilesLoaded(); | 230 observer_->OnSourceProfilesLoaded(); |
229 observer_ = NULL; | 231 observer_ = NULL; |
230 | 232 |
231 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. | 233 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. |
232 is_observed_ = false; | 234 is_observed_ = false; |
233 } | 235 } |
OLD | NEW |