| 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 #ifndef CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ | 6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/importer/importer_bridge.h" | 13 #include "chrome/browser/importer/importer_bridge.h" |
| 14 #include "chrome/browser/importer/profile_writer.h" | |
| 15 | 14 |
| 16 class GURL; | 15 class GURL; |
| 16 struct ImportedBookmarkEntry; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class DictionaryValue; | 19 class DictionaryValue; |
| 20 class TaskRunner; | 20 class TaskRunner; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace IPC { | 23 namespace IPC { |
| 24 class Message; | 24 class Message; |
| 25 class Sender; | 25 class Sender; |
| 26 } | 26 } |
| 27 | 27 |
| 28 // When the importer is run in an external process, the bridge is effectively | 28 // When the importer is run in an external process, the bridge is effectively |
| 29 // split in half by the IPC infrastructure. The external bridge receives data | 29 // split in half by the IPC infrastructure. The external bridge receives data |
| 30 // and notifications from the importer, and sends it across IPC. The | 30 // and notifications from the importer, and sends it across IPC. The |
| 31 // internal bridge gathers the data from the IPC host and writes it to the | 31 // internal bridge gathers the data from the IPC host and writes it to the |
| 32 // profile. | 32 // profile. |
| 33 class ExternalProcessImporterBridge : public ImporterBridge { | 33 class ExternalProcessImporterBridge : public ImporterBridge { |
| 34 public: | 34 public: |
| 35 ExternalProcessImporterBridge( | 35 ExternalProcessImporterBridge( |
| 36 const base::DictionaryValue& localized_strings, | 36 const base::DictionaryValue& localized_strings, |
| 37 IPC::Sender* sender, | 37 IPC::Sender* sender, |
| 38 base::TaskRunner* task_runner); | 38 base::TaskRunner* task_runner); |
| 39 | 39 |
| 40 // Begin ImporterBridge implementation: | 40 // Begin ImporterBridge implementation: |
| 41 virtual void AddBookmarks( | 41 virtual void AddBookmarks( |
| 42 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, | 42 const std::vector<ImportedBookmarkEntry>& bookmarks, |
| 43 const string16& first_folder_name) OVERRIDE; | 43 const string16& first_folder_name) OVERRIDE; |
| 44 | 44 |
| 45 virtual void AddHomePage(const GURL& home_page) OVERRIDE; | 45 virtual void AddHomePage(const GURL& home_page) OVERRIDE; |
| 46 | 46 |
| 47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 48 virtual void AddIE7PasswordInfo( | 48 virtual void AddIE7PasswordInfo( |
| 49 const IE7PasswordInfo& password_info) OVERRIDE; | 49 const IE7PasswordInfo& password_info) OVERRIDE; |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 virtual void SetFavicons( | 52 virtual void SetFavicons( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 // bundle isn't available to the external process. | 79 // bundle isn't available to the external process. |
| 80 scoped_ptr<base::DictionaryValue> localized_strings_; | 80 scoped_ptr<base::DictionaryValue> localized_strings_; |
| 81 | 81 |
| 82 IPC::Sender* sender_; | 82 IPC::Sender* sender_; |
| 83 scoped_refptr<base::TaskRunner> task_runner_; | 83 scoped_refptr<base::TaskRunner> task_runner_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterBridge); | 85 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterBridge); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ | 88 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ |
| OLD | NEW |