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