| 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/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_vector.h" | |
| 13 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 15 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 16 #include "components/favicon_base/favicon_usage_data.h" | 15 #include "components/favicon_base/favicon_usage_data.h" |
| 17 #include "components/history/core/browser/history_types.h" | 16 #include "components/history/core/browser/history_types.h" |
| 17 #include "components/search_engines/template_url_service.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 struct ImportedBookmarkEntry; | 20 struct ImportedBookmarkEntry; |
| 21 class Profile; | 21 class Profile; |
| 22 class TemplateURL; | |
| 23 | 22 |
| 24 namespace autofill { | 23 namespace autofill { |
| 25 struct PasswordForm; | 24 struct PasswordForm; |
| 26 class AutofillEntry; | 25 class AutofillEntry; |
| 27 } | 26 } |
| 28 | 27 |
| 29 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 30 struct IE7PasswordInfo; | 29 struct IE7PasswordInfo; |
| 31 #endif | 30 #endif |
| 32 | 31 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // If a folder with this name already exists, then the name is uniquified. | 70 // If a folder with this name already exists, then the name is uniquified. |
| 72 // For example, if |first_folder_name| is 'Imported from IE' and a folder with | 71 // For example, if |first_folder_name| is 'Imported from IE' and a folder with |
| 73 // the name 'Imported from IE' already exists in the bookmarks toolbar, then | 72 // the name 'Imported from IE' already exists in the bookmarks toolbar, then |
| 74 // we will instead create a subfolder named 'Imported from IE (1)'. | 73 // we will instead create a subfolder named 'Imported from IE (1)'. |
| 75 virtual void AddBookmarks( | 74 virtual void AddBookmarks( |
| 76 const std::vector<ImportedBookmarkEntry>& bookmarks, | 75 const std::vector<ImportedBookmarkEntry>& bookmarks, |
| 77 const base::string16& top_level_folder_name); | 76 const base::string16& top_level_folder_name); |
| 78 | 77 |
| 79 virtual void AddFavicons(const favicon_base::FaviconUsageDataList& favicons); | 78 virtual void AddFavicons(const favicon_base::FaviconUsageDataList& favicons); |
| 80 | 79 |
| 81 // Adds the TemplateURLs in |template_urls| to the local store. The local | 80 // Adds the TemplateURLs in |template_urls| to the local store. |
| 82 // store becomes the owner of the TemplateURLs. Some TemplateURLs in | 81 // Some TemplateURLs in |template_urls| may conflict (same keyword or same |
| 83 // |template_urls| may conflict (same keyword or same host name in the URL) | 82 // host name in the URL) with existing TemplateURLs in the local store, in |
| 84 // with existing TemplateURLs in the local store, in which case the existing | 83 // which case the existing ones take precedence and the duplicates in |
| 85 // ones take precedence and the duplicates in |template_urls| are deleted. | 84 // |template_urls| are deleted. If |unique_on_host_and_path| is true, a |
| 86 // If |unique_on_host_and_path| is true, a TemplateURL is only added if there | 85 // TemplateURL is only added if there is not an existing TemplateURL that has |
| 87 // is not an existing TemplateURL that has a replaceable search url with the | 86 // a replaceable search url with the same host+path combination. |
| 88 // same host+path combination. | 87 virtual void AddKeywords( |
| 89 virtual void AddKeywords(ScopedVector<TemplateURL> template_urls, | 88 TemplateURLService::OwnedTemplateURLVector template_urls, |
| 90 bool unique_on_host_and_path); | 89 bool unique_on_host_and_path); |
| 91 | 90 |
| 92 // Adds the imported autofill entries to the autofill database. | 91 // Adds the imported autofill entries to the autofill database. |
| 93 virtual void AddAutofillFormDataEntries( | 92 virtual void AddAutofillFormDataEntries( |
| 94 const std::vector<autofill::AutofillEntry>& autofill_entries); | 93 const std::vector<autofill::AutofillEntry>& autofill_entries); |
| 95 | 94 |
| 96 protected: | 95 protected: |
| 97 friend class base::RefCountedThreadSafe<ProfileWriter>; | 96 friend class base::RefCountedThreadSafe<ProfileWriter>; |
| 98 | 97 |
| 99 virtual ~ProfileWriter(); | 98 virtual ~ProfileWriter(); |
| 100 | 99 |
| 101 private: | 100 private: |
| 102 Profile* const profile_; | 101 Profile* const profile_; |
| 103 | 102 |
| 104 DISALLOW_COPY_AND_ASSIGN(ProfileWriter); | 103 DISALLOW_COPY_AND_ASSIGN(ProfileWriter); |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 #endif // CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ | 106 #endif // CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ |
| OLD | NEW |