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_IMPORTER_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ |
6 #define CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ | 6 #define CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/browser/history/history_types.h" | 15 #include "chrome/browser/history/history_types.h" |
16 #include "chrome/browser/importer/importer_data_types.h" | 16 #include "chrome/browser/importer/importer_data_types.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 struct IE7PasswordInfo; | 19 struct IE7PasswordInfo; |
20 struct ImportedBookmarkEntry; | 20 struct ImportedBookmarkEntry; |
21 struct ImportedFaviconUsage; | 21 struct ImportedFaviconUsage; |
22 | 22 |
23 namespace importer { | 23 namespace importer { |
24 struct URLKeywordInfo; | 24 struct URLKeywordInfo; |
25 } | 25 } |
26 | 26 |
27 // TODO: remove this, see friend declaration in ImporterBridge. | |
28 class Toolbar5Importer; | |
29 | |
30 namespace content { | 27 namespace content { |
31 struct PasswordForm; | 28 struct PasswordForm; |
32 } | 29 } |
33 | 30 |
34 class ImporterBridge : public base::RefCountedThreadSafe<ImporterBridge> { | 31 class ImporterBridge : public base::RefCountedThreadSafe<ImporterBridge> { |
35 public: | 32 public: |
36 ImporterBridge(); | 33 ImporterBridge(); |
37 | 34 |
38 virtual void AddBookmarks( | 35 virtual void AddBookmarks( |
39 const std::vector<ImportedBookmarkEntry>& bookmarks, | 36 const std::vector<ImportedBookmarkEntry>& bookmarks, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual void NotifyEnded() = 0; | 74 virtual void NotifyEnded() = 0; |
78 | 75 |
79 // For InProcessImporters this calls l10n_util. For ExternalProcessImporters | 76 // For InProcessImporters this calls l10n_util. For ExternalProcessImporters |
80 // this calls the set of strings we've ported over to the external process. | 77 // this calls the set of strings we've ported over to the external process. |
81 // It's good to avoid having to create a separate ResourceBundle for the | 78 // It's good to avoid having to create a separate ResourceBundle for the |
82 // external import process, since the importer only needs a few strings. | 79 // external import process, since the importer only needs a few strings. |
83 virtual string16 GetLocalizedString(int message_id) = 0; | 80 virtual string16 GetLocalizedString(int message_id) = 0; |
84 | 81 |
85 protected: | 82 protected: |
86 friend class base::RefCountedThreadSafe<ImporterBridge>; | 83 friend class base::RefCountedThreadSafe<ImporterBridge>; |
87 // TODO: In order to run Toolbar5Importer OOP we need to cut this | |
88 // connection, but as an interim step we allow Toolbar5Import to break | |
89 // the abstraction here and assume import is in-process. | |
90 friend class Toolbar5Importer; | |
91 | 84 |
92 virtual ~ImporterBridge(); | 85 virtual ~ImporterBridge(); |
93 | 86 |
94 DISALLOW_COPY_AND_ASSIGN(ImporterBridge); | 87 DISALLOW_COPY_AND_ASSIGN(ImporterBridge); |
95 }; | 88 }; |
96 | 89 |
97 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ | 90 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_ |
OLD | NEW |