| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/external_process_importer_bridge.h" | 5 #include "chrome/browser/importer/external_process_importer_bridge.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/history/history_types.h" | 11 #include "chrome/browser/history/history_types.h" |
| 12 #include "chrome/profile_import/profile_import_thread.h" | 12 #include "chrome/profile_import/profile_import_thread.h" |
| 13 #include "webkit/glue/password_form.h" | 13 #include "webkit/glue/password_form.h" |
| 14 | 14 |
| 15 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
| 16 #include "chrome/browser/password_manager/ie7_password.h" | 16 #include "chrome/browser/password_manager/ie7_password.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 ExternalProcessImporterBridge::ExternalProcessImporterBridge( | 19 ExternalProcessImporterBridge::ExternalProcessImporterBridge( |
| 20 ProfileImportThread* profile_import_thread, | 20 ProfileImportThread* profile_import_thread, |
| 21 const DictionaryValue& localized_strings) | 21 const DictionaryValue& localized_strings) |
| 22 : profile_import_thread_(profile_import_thread) { | 22 : profile_import_thread_(profile_import_thread) { |
| 23 // Bridge needs to make its own copy because OS 10.6 autoreleases the | 23 // Bridge needs to make its own copy because OS 10.6 autoreleases the |
| 24 // localized_strings value that is passed in (see http://crbug.com/46003 ). | 24 // localized_strings value that is passed in (see http://crbug.com/46003 ). |
| 25 localized_strings_.reset(localized_strings.DeepCopy()); | 25 localized_strings_.reset(localized_strings.DeepCopy()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void ExternalProcessImporterBridge::AddBookmarks( | 28 void ExternalProcessImporterBridge::AddBookmarks( |
| 29 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, | 29 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, |
| 30 const string16& first_folder_name, | 30 const string16& first_folder_name) { |
| 31 int options) { | |
| 32 profile_import_thread_->NotifyBookmarksImportReady(bookmarks, | 31 profile_import_thread_->NotifyBookmarksImportReady(bookmarks, |
| 33 first_folder_name, | 32 first_folder_name); |
| 34 options); | |
| 35 } | 33 } |
| 36 | 34 |
| 37 void ExternalProcessImporterBridge::AddHomePage(const GURL& home_page) { | 35 void ExternalProcessImporterBridge::AddHomePage(const GURL& home_page) { |
| 38 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
| 39 } | 37 } |
| 40 | 38 |
| 41 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
| 42 void ExternalProcessImporterBridge::AddIE7PasswordInfo( | 40 void ExternalProcessImporterBridge::AddIE7PasswordInfo( |
| 43 const IE7PasswordInfo& password_info) { | 41 const IE7PasswordInfo& password_info) { |
| 44 NOTIMPLEMENTED(); | 42 NOTIMPLEMENTED(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // The internal process detects import end when all items have been received. | 84 // The internal process detects import end when all items have been received. |
| 87 } | 85 } |
| 88 | 86 |
| 89 string16 ExternalProcessImporterBridge::GetLocalizedString(int message_id) { | 87 string16 ExternalProcessImporterBridge::GetLocalizedString(int message_id) { |
| 90 string16 message; | 88 string16 message; |
| 91 localized_strings_->GetString(base::IntToString(message_id), &message); | 89 localized_strings_->GetString(base::IntToString(message_id), &message); |
| 92 return message; | 90 return message; |
| 93 } | 91 } |
| 94 | 92 |
| 95 ExternalProcessImporterBridge::~ExternalProcessImporterBridge() {} | 93 ExternalProcessImporterBridge::~ExternalProcessImporterBridge() {} |
| OLD | NEW |