| 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_IN_PROCESS_IMPORTER_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_ | 6 #define CHROME_BROWSER_IMPORTER_IN_PROCESS_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/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "chrome/browser/importer/importer_bridge.h" | 15 #include "chrome/browser/importer/importer_bridge.h" |
| 16 #include "chrome/browser/importer/profile_writer.h" | 16 #include "chrome/browser/importer/profile_writer.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 struct ImportedBookmarkEntry; |
| 20 struct ImportedFaviconUsage; |
| 19 class ImporterHost; | 21 class ImporterHost; |
| 20 | 22 |
| 21 class InProcessImporterBridge : public ImporterBridge { | 23 class InProcessImporterBridge : public ImporterBridge { |
| 22 public: | 24 public: |
| 23 InProcessImporterBridge(ProfileWriter* writer, | 25 InProcessImporterBridge(ProfileWriter* writer, |
| 24 base::WeakPtr<ImporterHost> host); | 26 base::WeakPtr<ImporterHost> host); |
| 25 | 27 |
| 26 // Begin ImporterBridge implementation: | 28 // Begin ImporterBridge implementation: |
| 27 virtual void AddBookmarks( | 29 virtual void AddBookmarks( |
| 28 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks, | 30 const std::vector<ImportedBookmarkEntry>& bookmarks, |
| 29 const string16& first_folder_name) OVERRIDE; | 31 const string16& first_folder_name) OVERRIDE; |
| 30 | 32 |
| 31 virtual void AddHomePage(const GURL& home_page) OVERRIDE; | 33 virtual void AddHomePage(const GURL& home_page) OVERRIDE; |
| 32 | 34 |
| 33 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 34 virtual void AddIE7PasswordInfo( | 36 virtual void AddIE7PasswordInfo( |
| 35 const IE7PasswordInfo& password_info) OVERRIDE; | 37 const IE7PasswordInfo& password_info) OVERRIDE; |
| 36 #endif | 38 #endif |
| 37 | 39 |
| 38 virtual void SetFavicons( | 40 virtual void SetFavicons( |
| 39 const std::vector<history::ImportedFaviconUsage>& favicons) OVERRIDE; | 41 const std::vector<ImportedFaviconUsage>& favicons) OVERRIDE; |
| 40 | 42 |
| 41 virtual void SetHistoryItems(const history::URLRows& rows, | 43 virtual void SetHistoryItems(const history::URLRows& rows, |
| 42 history::VisitSource visit_source) OVERRIDE; | 44 history::VisitSource visit_source) OVERRIDE; |
| 43 | 45 |
| 44 virtual void SetKeywords(const std::vector<TemplateURL*>& template_urls, | 46 virtual void SetKeywords(const std::vector<TemplateURL*>& template_urls, |
| 45 bool unique_on_host_and_path) OVERRIDE; | 47 bool unique_on_host_and_path) OVERRIDE; |
| 46 | 48 |
| 47 virtual void SetPasswordForm( | 49 virtual void SetPasswordForm( |
| 48 const content::PasswordForm& form) OVERRIDE; | 50 const content::PasswordForm& form) OVERRIDE; |
| 49 | 51 |
| 50 virtual void NotifyStarted() OVERRIDE; | 52 virtual void NotifyStarted() OVERRIDE; |
| 51 virtual void NotifyItemStarted(importer::ImportItem item) OVERRIDE; | 53 virtual void NotifyItemStarted(importer::ImportItem item) OVERRIDE; |
| 52 virtual void NotifyItemEnded(importer::ImportItem item) OVERRIDE; | 54 virtual void NotifyItemEnded(importer::ImportItem item) OVERRIDE; |
| 53 virtual void NotifyEnded() OVERRIDE; | 55 virtual void NotifyEnded() OVERRIDE; |
| 54 | 56 |
| 55 virtual string16 GetLocalizedString(int message_id) OVERRIDE; | 57 virtual string16 GetLocalizedString(int message_id) OVERRIDE; |
| 56 // End ImporterBridge implementation. | 58 // End ImporterBridge implementation. |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 virtual ~InProcessImporterBridge(); | 61 virtual ~InProcessImporterBridge(); |
| 60 | 62 |
| 61 ProfileWriter* const writer_; // weak | 63 ProfileWriter* const writer_; // weak |
| 62 const base::WeakPtr<ImporterHost> host_; | 64 const base::WeakPtr<ImporterHost> host_; |
| 63 | 65 |
| 64 DISALLOW_COPY_AND_ASSIGN(InProcessImporterBridge); | 66 DISALLOW_COPY_AND_ASSIGN(InProcessImporterBridge); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 #endif // CHROME_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_ | 69 #endif // CHROME_BROWSER_IMPORTER_IN_PROCESS_IMPORTER_BRIDGE_H_ |
| OLD | NEW |