Revert "Only store leading 13 bits of password hash."
[chromium-blink-merge.git] / chrome / utility / importer / external_process_importer_bridge.h
blob26473021fd69387ba7ac32689781a462879e8b37
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
3 // found in the LICENSE file.
5 #ifndef CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
6 #define CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/common/importer/importer_bridge.h"
16 class GURL;
17 struct ImportedBookmarkEntry;
19 namespace base {
20 class DictionaryValue;
21 class TaskRunner;
24 namespace importer {
25 #if defined(OS_WIN)
26 struct ImporterIE7PasswordInfo;
27 #endif
28 struct ImporterURLRow;
29 struct SearchEngineInfo;
32 namespace IPC {
33 class Message;
34 class Sender;
37 // When the importer is run in an external process, the bridge is effectively
38 // split in half by the IPC infrastructure. The external bridge receives data
39 // and notifications from the importer, and sends it across IPC. The
40 // internal bridge gathers the data from the IPC host and writes it to the
41 // profile.
42 class ExternalProcessImporterBridge : public ImporterBridge {
43 public:
44 ExternalProcessImporterBridge(
45 const base::DictionaryValue& localized_strings,
46 IPC::Sender* sender,
47 base::TaskRunner* task_runner);
49 // Begin ImporterBridge implementation:
50 void AddBookmarks(const std::vector<ImportedBookmarkEntry>& bookmarks,
51 const base::string16& first_folder_name) override;
53 void AddHomePage(const GURL& home_page) override;
55 #if defined(OS_WIN)
56 virtual void AddIE7PasswordInfo(
57 const importer::ImporterIE7PasswordInfo& password_info) override;
58 #endif
60 void SetFavicons(const std::vector<ImportedFaviconUsage>& favicons) override;
62 void SetHistoryItems(const std::vector<ImporterURLRow>& rows,
63 importer::VisitSource visit_source) override;
65 void SetKeywords(
66 const std::vector<importer::SearchEngineInfo>& search_engines,
67 bool unique_on_host_and_path) override;
69 void SetFirefoxSearchEnginesXMLData(
70 const std::vector<std::string>& seach_engine_data) override;
72 void SetPasswordForm(const autofill::PasswordForm& form) override;
74 void SetAutofillFormData(
75 const std::vector<ImporterAutofillFormDataEntry>& entries) override;
77 void NotifyStarted() override;
78 void NotifyItemStarted(importer::ImportItem item) override;
79 void NotifyItemEnded(importer::ImportItem item) override;
80 void NotifyEnded() override;
82 base::string16 GetLocalizedString(int message_id) override;
83 // End ImporterBridge implementation.
85 private:
86 ~ExternalProcessImporterBridge() override;
88 void Send(IPC::Message* message);
89 void SendInternal(IPC::Message* message);
91 // Holds strings needed by the external importer because the resource
92 // bundle isn't available to the external process.
93 scoped_ptr<base::DictionaryValue> localized_strings_;
95 IPC::Sender* sender_;
96 scoped_refptr<base::TaskRunner> task_runner_;
98 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterBridge);
101 #endif // CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_