OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FIREFOX3_IMPORTER_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_ |
6 #define CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_ | 6 #define CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "chrome/browser/importer/importer.h" | 16 #include "chrome/browser/importer/importer.h" |
17 #include "chrome/browser/importer/importer_data_types.h" | 17 #include "chrome/browser/importer/importer_data_types.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
19 | 19 |
20 struct sqlite3; | 20 struct sqlite3; |
21 | 21 |
22 // Importer for Mozilla Firefox 3. | 22 // Importer for Mozilla Firefox 3. |
23 // Firefox 3 stores its persistent information in a new system called places. | 23 // Firefox 3 stores its persistent information in a new system called places. |
24 // http://wiki.mozilla.org/Places | 24 // http://wiki.mozilla.org/Places |
25 class Firefox3Importer : public Importer { | 25 class Firefox3Importer : public Importer { |
26 public: | 26 public: |
27 Firefox3Importer() { } | 27 Firefox3Importer(); |
28 | 28 |
29 // Importer methods. | 29 // Importer methods. |
30 virtual void StartImport(importer::ProfileInfo profile_info, | 30 virtual void StartImport(importer::ProfileInfo profile_info, |
31 uint16 items, | 31 uint16 items, |
32 ImporterBridge* bridge); | 32 ImporterBridge* bridge); |
33 | 33 |
34 private: | 34 private: |
35 typedef std::map<int64, std::set<GURL> > FaviconMap; | 35 typedef std::map<int64, std::set<GURL> > FaviconMap; |
36 | 36 |
37 virtual ~Firefox3Importer() { } | 37 virtual ~Firefox3Importer(); |
38 | 38 |
39 void ImportBookmarks(); | 39 void ImportBookmarks(); |
40 void ImportPasswords(); | 40 void ImportPasswords(); |
41 void ImportHistory(); | 41 void ImportHistory(); |
42 void ImportSearchEngines(); | 42 void ImportSearchEngines(); |
43 // Import the user's home page, unless it is set to default home page as | 43 // Import the user's home page, unless it is set to default home page as |
44 // defined in browserconfig.properties. | 44 // defined in browserconfig.properties. |
45 void ImportHomepage(); | 45 void ImportHomepage(); |
46 void GetSearchEnginesXMLFiles(std::vector<FilePath>* files); | 46 void GetSearchEnginesXMLFiles(std::vector<FilePath>* files); |
47 | 47 |
(...skipping 27 matching lines...) Expand all Loading... |
75 | 75 |
76 // Loads the favicons given in the map from the database, loads the data, | 76 // Loads the favicons given in the map from the database, loads the data, |
77 // and converts it into FaviconUsage structures. | 77 // and converts it into FaviconUsage structures. |
78 void LoadFavicons(sqlite3* db, | 78 void LoadFavicons(sqlite3* db, |
79 const FaviconMap& favicon_map, | 79 const FaviconMap& favicon_map, |
80 std::vector<history::ImportedFavIconUsage>* favicons); | 80 std::vector<history::ImportedFavIconUsage>* favicons); |
81 | 81 |
82 FilePath source_path_; | 82 FilePath source_path_; |
83 FilePath app_path_; | 83 FilePath app_path_; |
84 | 84 |
| 85 // Stored because we can only access it from the UI thread. |
| 86 std::string locale_; |
| 87 |
85 DISALLOW_COPY_AND_ASSIGN(Firefox3Importer); | 88 DISALLOW_COPY_AND_ASSIGN(Firefox3Importer); |
86 }; | 89 }; |
87 | 90 |
88 #endif // CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_ | 91 #endif // CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_ |
OLD | NEW |