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.h" | 5 #include "chrome/browser/importer/importer.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
| 12 #include "chrome/browser/browser_navigator.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/browser_thread.h" | 14 #include "chrome/browser/browser_thread.h" |
14 #include "chrome/browser/browsing_instance.h" | 15 #include "chrome/browser/browsing_instance.h" |
15 #include "chrome/browser/importer/firefox_profile_lock.h" | 16 #include "chrome/browser/importer/firefox_profile_lock.h" |
16 #include "chrome/browser/importer/importer_bridge.h" | 17 #include "chrome/browser/importer/importer_bridge.h" |
17 #include "chrome/browser/renderer_host/site_instance.h" | 18 #include "chrome/browser/renderer_host/site_instance.h" |
18 #include "chrome/browser/search_engines/template_url.h" | 19 #include "chrome/browser/search_engines/template_url.h" |
19 #include "chrome/browser/search_engines/template_url_model.h" | 20 #include "chrome/browser/search_engines/template_url_model.h" |
20 #include "chrome/browser/tabs/tab_strip_model.h" | 21 #include "chrome/browser/tabs/tab_strip_model.h" |
21 #include "chrome/browser/webdata/web_data_service.h" | 22 #include "chrome/browser/webdata/web_data_service.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // credentials. | 194 // credentials. |
194 if (profile_info.browser_type == importer::GOOGLE_TOOLBAR5) { | 195 if (profile_info.browser_type == importer::GOOGLE_TOOLBAR5) { |
195 if (!toolbar_importer_utils::IsGoogleGAIACookieInstalled()) { | 196 if (!toolbar_importer_utils::IsGoogleGAIACookieInstalled()) { |
196 win_util::MessageBox( | 197 win_util::MessageBox( |
197 NULL, | 198 NULL, |
198 l10n_util::GetString(IDS_IMPORTER_GOOGLE_LOGIN_TEXT).c_str(), | 199 l10n_util::GetString(IDS_IMPORTER_GOOGLE_LOGIN_TEXT).c_str(), |
199 L"", | 200 L"", |
200 MB_OK | MB_TOPMOST); | 201 MB_OK | MB_TOPMOST); |
201 | 202 |
202 GURL url("https://www.google.com/accounts/ServiceLogin"); | 203 GURL url("https://www.google.com/accounts/ServiceLogin"); |
203 Browser* browser = BrowserList::GetLastActive(); | 204 BrowserList::GetLastActive()->AddSelectedTabWithURL( |
204 Browser::AddTabWithURLParams params(url, PageTransition::TYPED); | 205 url, PageTransition::TYPED); |
205 // BrowsingInstance is refcounted. | |
206 BrowsingInstance* instance = new BrowsingInstance(writer_->profile()); | |
207 params.instance = instance->GetSiteInstanceForURL(url); | |
208 browser->AddTabWithURL(¶ms); | |
209 | 206 |
210 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 207 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
211 this, &ImporterHost::OnLockViewEnd, false)); | 208 this, &ImporterHost::OnLockViewEnd, false)); |
212 | 209 |
213 is_source_readable_ = false; | 210 is_source_readable_ = false; |
214 } | 211 } |
215 } | 212 } |
216 #endif | 213 #endif |
217 | 214 |
218 CheckForLoadedModels(items); | 215 CheckForLoadedModels(items); |
219 AddRef(); | 216 AddRef(); |
220 InvokeTaskIfDone(); | 217 InvokeTaskIfDone(); |
221 } | 218 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 template_url_vec.reserve(template_urls.size()); | 583 template_url_vec.reserve(template_urls.size()); |
587 std::vector<TemplateURL>::const_iterator iter; | 584 std::vector<TemplateURL>::const_iterator iter; |
588 for (iter = template_urls.begin(); | 585 for (iter = template_urls.begin(); |
589 iter != template_urls.end(); | 586 iter != template_urls.end(); |
590 ++iter) { | 587 ++iter) { |
591 template_url_vec.push_back(new TemplateURL(*iter)); | 588 template_url_vec.push_back(new TemplateURL(*iter)); |
592 } | 589 } |
593 bridge_->SetKeywords(template_url_vec, default_keyword_index, | 590 bridge_->SetKeywords(template_url_vec, default_keyword_index, |
594 unique_on_host_and_path); | 591 unique_on_host_and_path); |
595 } | 592 } |
OLD | NEW |