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_PROFILE_WRITER_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ |
6 #define CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ | 6 #define CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "chrome/browser/history/history_types.h" | 16 #include "chrome/browser/history/history_types.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 struct ImportedBookmarkEntry; | 19 struct ImportedBookmarkEntry; |
20 struct ImportedFaviconUsage; | 20 struct ImportedFaviconUsage; |
21 class Profile; | 21 class Profile; |
22 class TemplateURL; | 22 class TemplateURL; |
23 | 23 |
24 namespace autofill { | 24 namespace autofill { |
25 struct PasswordForm; | 25 struct PasswordForm; |
| 26 class AutofillEntry; |
26 } | 27 } |
27 | 28 |
28 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
29 struct IE7PasswordInfo; | 30 struct IE7PasswordInfo; |
30 #endif | 31 #endif |
31 | 32 |
32 // ProfileWriter encapsulates profile for writing entries into it. | 33 // ProfileWriter encapsulates profile for writing entries into it. |
33 // This object must be invoked on UI thread. | 34 // This object must be invoked on UI thread. |
34 class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { | 35 class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { |
35 public: | 36 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // store becomes the owner of the TemplateURLs. Some TemplateURLs in | 83 // store becomes the owner of the TemplateURLs. Some TemplateURLs in |
83 // |template_urls| may conflict (same keyword or same host name in the URL) | 84 // |template_urls| may conflict (same keyword or same host name in the URL) |
84 // with existing TemplateURLs in the local store, in which case the existing | 85 // with existing TemplateURLs in the local store, in which case the existing |
85 // ones take precedence and the duplicates in |template_urls| are deleted. | 86 // ones take precedence and the duplicates in |template_urls| are deleted. |
86 // If |unique_on_host_and_path| is true, a TemplateURL is only added if there | 87 // If |unique_on_host_and_path| is true, a TemplateURL is only added if there |
87 // is not an existing TemplateURL that has a replaceable search url with the | 88 // is not an existing TemplateURL that has a replaceable search url with the |
88 // same host+path combination. | 89 // same host+path combination. |
89 virtual void AddKeywords(ScopedVector<TemplateURL> template_urls, | 90 virtual void AddKeywords(ScopedVector<TemplateURL> template_urls, |
90 bool unique_on_host_and_path); | 91 bool unique_on_host_and_path); |
91 | 92 |
| 93 // Adds the imported autofill entries to the autofill database. |
| 94 virtual void AddAutofillFormDataEntries( |
| 95 const std::vector<autofill::AutofillEntry>& autofill_entries); |
| 96 |
92 protected: | 97 protected: |
93 friend class base::RefCountedThreadSafe<ProfileWriter>; | 98 friend class base::RefCountedThreadSafe<ProfileWriter>; |
94 | 99 |
95 virtual ~ProfileWriter(); | 100 virtual ~ProfileWriter(); |
96 | 101 |
97 private: | 102 private: |
98 Profile* const profile_; | 103 Profile* const profile_; |
99 | 104 |
100 DISALLOW_COPY_AND_ASSIGN(ProfileWriter); | 105 DISALLOW_COPY_AND_ASSIGN(ProfileWriter); |
101 }; | 106 }; |
102 | 107 |
103 #endif // CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ | 108 #endif // CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ |
OLD | NEW |