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_host.h" | 5 #include "chrome/browser/importer/importer_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 NULL, | 167 NULL, |
168 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 168 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
169 l10n_util::GetStringUTF16(IDS_IMPORTER_GOOGLE_LOGIN_TEXT), | 169 l10n_util::GetStringUTF16(IDS_IMPORTER_GOOGLE_LOGIN_TEXT), |
170 chrome::MESSAGE_BOX_TYPE_INFORMATION); | 170 chrome::MESSAGE_BOX_TYPE_INFORMATION); |
171 | 171 |
172 GURL url("https://accounts.google.com/ServiceLogin"); | 172 GURL url("https://accounts.google.com/ServiceLogin"); |
173 if (browser_) | 173 if (browser_) |
174 chrome::AddSelectedTabWithURL(browser_, url, | 174 chrome::AddSelectedTabWithURL(browser_, url, |
175 content::PAGE_TRANSITION_TYPED); | 175 content::PAGE_TRANSITION_TYPED); |
176 | 176 |
177 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( | 177 base::MessageLoop::current()->PostTask( |
178 &ImporterHost::OnImportLockDialogEnd, this, false)); | 178 FROM_HERE, |
| 179 base::Bind(&ImporterHost::OnImportLockDialogEnd, this, false)); |
179 } else { | 180 } else { |
180 is_source_readable_ = true; | 181 is_source_readable_ = true; |
181 InvokeTaskIfDone(); | 182 InvokeTaskIfDone(); |
182 } | 183 } |
183 #endif | 184 #endif |
184 } | 185 } |
185 | 186 |
186 void ImporterHost::Cancel() { | 187 void ImporterHost::Cancel() { |
187 if (importer_) | 188 if (importer_) |
188 importer_->Cancel(); | 189 importer_->Cancel(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 const content::NotificationDetails& details) { | 270 const content::NotificationDetails& details) { |
270 DCHECK(type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED); | 271 DCHECK(type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED); |
271 registrar_.RemoveAll(); | 272 registrar_.RemoveAll(); |
272 InvokeTaskIfDone(); | 273 InvokeTaskIfDone(); |
273 } | 274 } |
274 | 275 |
275 void ImporterHost::OnBrowserRemoved(Browser* browser) { | 276 void ImporterHost::OnBrowserRemoved(Browser* browser) { |
276 if (browser_ == browser) | 277 if (browser_ == browser) |
277 browser_ = NULL; | 278 browser_ = NULL; |
278 } | 279 } |
OLD | NEW |