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 #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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/importer/importer_bridge.h" | 14 #include "chrome/browser/importer/importer_bridge.h" |
15 #include "chrome/browser/importer/profile_writer.h" | 15 #include "chrome/browser/importer/profile_writer.h" |
16 #include "ipc/ipc_message.h" | |
Dirk Pranke
2011/11/29 01:27:24
Can't you forward-declare IPC::Message:;Sender her
jam
2011/11/29 01:46:13
unfortunately we can't forward declare it because
| |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 | 19 |
19 namespace IPC { | |
20 class Message; | |
21 } | |
22 | |
23 namespace base { | 20 namespace base { |
24 class DictionaryValue; | 21 class DictionaryValue; |
25 } | 22 } |
26 | 23 |
27 // When the importer is run in an external process, the bridge is effectively | 24 // When the importer is run in an external process, the bridge is effectively |
28 // split in half by the IPC infrastructure. The external bridge receives data | 25 // split in half by the IPC infrastructure. The external bridge receives data |
29 // and notifications from the importer, and sends it across IPC. The | 26 // and notifications from the importer, and sends it across IPC. The |
30 // internal bridge gathers the data from the IPC host and writes it to the | 27 // internal bridge gathers the data from the IPC host and writes it to the |
31 // profile. | 28 // profile. |
32 class ExternalProcessImporterBridge : public ImporterBridge { | 29 class ExternalProcessImporterBridge : public ImporterBridge { |
33 public: | 30 public: |
34 explicit ExternalProcessImporterBridge( | 31 ExternalProcessImporterBridge( |
35 const base::DictionaryValue& localized_strings); | 32 const base::DictionaryValue& localized_strings, |
33 IPC::Message::Sender* sender); | |
36 | 34 |
37 // Begin ImporterBridge implementation: | 35 // Begin ImporterBridge implementation: |
38 virtual void AddBookmarks( | 36 virtual void AddBookmarks( |
39 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, | 37 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, |
40 const string16& first_folder_name) OVERRIDE; | 38 const string16& first_folder_name) OVERRIDE; |
41 | 39 |
42 virtual void AddHomePage(const GURL& home_page) OVERRIDE; | 40 virtual void AddHomePage(const GURL& home_page) OVERRIDE; |
43 | 41 |
44 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
45 virtual void AddIE7PasswordInfo( | 43 virtual void AddIE7PasswordInfo( |
(...skipping 22 matching lines...) Expand all Loading... | |
68 | 66 |
69 private: | 67 private: |
70 virtual ~ExternalProcessImporterBridge(); | 68 virtual ~ExternalProcessImporterBridge(); |
71 | 69 |
72 bool Send(IPC::Message* message); | 70 bool Send(IPC::Message* message); |
73 | 71 |
74 // Holds strings needed by the external importer because the resource | 72 // Holds strings needed by the external importer because the resource |
75 // bundle isn't available to the external process. | 73 // bundle isn't available to the external process. |
76 scoped_ptr<base::DictionaryValue> localized_strings_; | 74 scoped_ptr<base::DictionaryValue> localized_strings_; |
77 | 75 |
76 IPC::Message::Sender* sender_; | |
77 | |
78 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterBridge); | 78 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterBridge); |
79 }; | 79 }; |
80 | 80 |
81 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ | 81 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ |
OLD | NEW |