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_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_
6 #define CHROME_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/weak_ptr.h"
14 #include "build/build_config.h"
15 #include "chrome/browser/importer/profile_writer.h"
16 #include "chrome/common/importer/importer_bridge.h"
19 struct ImportedBookmarkEntry
;
20 struct ImportedFaviconUsage
;
21 class ExternalProcessImporterHost
;
25 struct ImporterIE7PasswordInfo
;
27 struct ImporterURlRow
;
28 struct URLKeywordInfo
;
31 class InProcessImporterBridge
: public ImporterBridge
{
33 InProcessImporterBridge(ProfileWriter
* writer
,
34 base::WeakPtr
<ExternalProcessImporterHost
> host
);
36 // Begin ImporterBridge implementation:
37 virtual void AddBookmarks(
38 const std::vector
<ImportedBookmarkEntry
>& bookmarks
,
39 const base::string16
& first_folder_name
) OVERRIDE
;
41 virtual void AddHomePage(const GURL
& home_page
) OVERRIDE
;
44 virtual void AddIE7PasswordInfo(
45 const importer::ImporterIE7PasswordInfo
& password_info
) OVERRIDE
;
48 virtual void SetFavicons(
49 const std::vector
<ImportedFaviconUsage
>& favicons
) OVERRIDE
;
51 virtual void SetHistoryItems(const std::vector
<ImporterURLRow
>& rows
,
52 importer::VisitSource visit_source
) OVERRIDE
;
54 virtual void SetKeywords(
55 const std::vector
<importer::URLKeywordInfo
>& url_keywords
,
56 bool unique_on_host_and_path
) OVERRIDE
;
58 virtual void SetFirefoxSearchEnginesXMLData(
59 const std::vector
<std::string
>& search_engine_data
) OVERRIDE
;
61 virtual void SetPasswordForm(
62 const autofill::PasswordForm
& form
) OVERRIDE
;
64 virtual void NotifyStarted() OVERRIDE
;
65 virtual void NotifyItemStarted(importer::ImportItem item
) OVERRIDE
;
66 virtual void NotifyItemEnded(importer::ImportItem item
) OVERRIDE
;
67 virtual void NotifyEnded() OVERRIDE
;
69 virtual base::string16
GetLocalizedString(int message_id
) OVERRIDE
;
70 // End ImporterBridge implementation.
73 virtual ~InProcessImporterBridge();
75 ProfileWriter
* const writer_
; // weak
76 const base::WeakPtr
<ExternalProcessImporterHost
> host_
;
78 DISALLOW_COPY_AND_ASSIGN(InProcessImporterBridge
);
81 #endif // CHROME_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_