| 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/in_process_importer_bridge.h" | 5 #include "chrome/browser/importer/in_process_importer_bridge.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" |
| 9 #include "chrome/browser/importer/importer_host.h" | 10 #include "chrome/browser/importer/importer_host.h" |
| 10 #include "chrome/browser/search_engines/template_url.h" | 11 #include "chrome/browser/search_engines/template_url.h" |
| 11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/common/password_form.h" | 13 #include "content/public/common/password_form.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 14 | 15 |
| 15 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 16 #include "components/webdata/encryptor/ie7_password.h" | 17 #include "components/webdata/encryptor/ie7_password.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 #include <iterator> | 20 #include <iterator> |
| 20 | 21 |
| 21 using content::BrowserThread; | 22 using content::BrowserThread; |
| 22 | 23 |
| 23 InProcessImporterBridge::InProcessImporterBridge( | 24 InProcessImporterBridge::InProcessImporterBridge( |
| 24 ProfileWriter* writer, | 25 ProfileWriter* writer, |
| 25 base::WeakPtr<ImporterHost> host) : writer_(writer), | 26 base::WeakPtr<ImporterHost> host) : writer_(writer), |
| 26 host_(host) { | 27 host_(host) { |
| 27 } | 28 } |
| 28 | 29 |
| 29 void InProcessImporterBridge::AddBookmarks( | 30 void InProcessImporterBridge::AddBookmarks( |
| 30 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, | 31 const std::vector<ImportedBookmarkEntry>& bookmarks, |
| 31 const string16& first_folder_name) { | 32 const string16& first_folder_name) { |
| 32 BrowserThread::PostTask( | 33 BrowserThread::PostTask( |
| 33 BrowserThread::UI, FROM_HERE, | 34 BrowserThread::UI, FROM_HERE, |
| 34 base::Bind(&ProfileWriter::AddBookmarks, writer_, bookmarks, | 35 base::Bind(&ProfileWriter::AddBookmarks, writer_, bookmarks, |
| 35 first_folder_name)); | 36 first_folder_name)); |
| 36 } | 37 } |
| 37 | 38 |
| 38 void InProcessImporterBridge::AddHomePage(const GURL& home_page) { | 39 void InProcessImporterBridge::AddHomePage(const GURL& home_page) { |
| 39 BrowserThread::PostTask( | 40 BrowserThread::PostTask( |
| 40 BrowserThread::UI, FROM_HERE, | 41 BrowserThread::UI, FROM_HERE, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 BrowserThread::PostTask( | 106 BrowserThread::PostTask( |
| 106 BrowserThread::UI, FROM_HERE, | 107 BrowserThread::UI, FROM_HERE, |
| 107 base::Bind(&ImporterHost::NotifyImportEnded, host_)); | 108 base::Bind(&ImporterHost::NotifyImportEnded, host_)); |
| 108 } | 109 } |
| 109 | 110 |
| 110 string16 InProcessImporterBridge::GetLocalizedString(int message_id) { | 111 string16 InProcessImporterBridge::GetLocalizedString(int message_id) { |
| 111 return l10n_util::GetStringUTF16(message_id); | 112 return l10n_util::GetStringUTF16(message_id); |
| 112 } | 113 } |
| 113 | 114 |
| 114 InProcessImporterBridge::~InProcessImporterBridge() {} | 115 InProcessImporterBridge::~InProcessImporterBridge() {} |
| OLD | NEW |