OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ | |
6 #define CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/memory/ref_counted.h" | |
13 #include "base/strings/string16.h" | |
14 #include "build/build_config.h" | |
15 #include "chrome/browser/history/history_types.h" | |
16 #include "chrome/common/importer/importer_data_types.h" | |
17 #include "chrome/common/importer/importer_url_row.h" | |
18 | |
19 class GURL; | |
20 struct ImportedBookmarkEntry; | |
21 struct ImportedFaviconUsage; | |
22 | |
23 namespace importer { | |
24 #if defined(OS_WIN) | |
25 struct ImporterIE7PasswordInfo; | |
26 #endif | |
27 struct ImporterURlRow; | |
28 struct URLKeywordInfo; | |
29 } | |
30 | |
31 namespace content { | |
32 struct PasswordForm; | |
33 } | |
34 | |
35 class ImporterBridge : public base::RefCountedThreadSafe<ImporterBridge> { | |
36 public: | |
37 ImporterBridge(); | |
38 | |
39 virtual void AddBookmarks( | |
40 const std::vector<ImportedBookmarkEntry>& bookmarks, | |
41 const string16& first_folder_name) = 0; | |
42 | |
43 virtual void AddHomePage(const GURL& home_page) = 0; | |
44 | |
45 #if defined(OS_WIN) | |
46 virtual void AddIE7PasswordInfo( | |
47 const importer::ImporterIE7PasswordInfo& password_info) = 0; | |
48 #endif | |
49 | |
50 virtual void SetFavicons( | |
51 const std::vector<ImportedFaviconUsage>& favicons) = 0; | |
52 | |
53 virtual void SetHistoryItems(const std::vector<ImporterURLRow>& rows, | |
54 importer::VisitSource visit_source) = 0; | |
55 | |
56 virtual void SetKeywords( | |
57 const std::vector<importer::URLKeywordInfo>& url_keywords, | |
58 bool unique_on_host_and_path) = 0; | |
59 | |
60 // The search_engine_data vector contains XML data retrieved from the Firefox | |
61 // profile and its sqlite db. | |
62 virtual void SetFirefoxSearchEnginesXMLData( | |
63 const std::vector<std::string>& search_engine_data) = 0; | |
64 | |
65 virtual void SetPasswordForm(const content::PasswordForm& form) = 0; | |
66 | |
67 // Notifies the coordinator that the import operation has begun. | |
68 virtual void NotifyStarted() = 0; | |
69 | |
70 // Notifies the coordinator that the collection of data for the specified | |
71 // item has begun. | |
72 virtual void NotifyItemStarted(importer::ImportItem item) = 0; | |
73 | |
74 // Notifies the coordinator that the collection of data for the specified | |
75 // item has completed. | |
76 virtual void NotifyItemEnded(importer::ImportItem item) = 0; | |
77 | |
78 // Notifies the coordinator that the entire import operation has completed. | |
79 virtual void NotifyEnded() = 0; | |
80 | |
81 // For InProcessImporters this calls l10n_util. For ExternalProcessImporters | |
82 // this calls the set of strings we've ported over to the external process. | |
83 // It's good to avoid having to create a separate ResourceBundle for the | |
84 // external import process, since the importer only needs a few strings. | |
85 virtual string16 GetLocalizedString(int message_id) = 0; | |
86 | |
87 protected: | |
88 friend class base::RefCountedThreadSafe<ImporterBridge>; | |
89 | |
90 virtual ~ImporterBridge(); | |
91 | |
92 DISALLOW_COPY_AND_ASSIGN(ImporterBridge); | |
93 }; | |
94 | |
95 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ | |
OLD | NEW |