| 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 content { | 24 namespace autofill { |
| 25 struct PasswordForm; | 25 struct PasswordForm; |
| 26 } | 26 } |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 struct IE7PasswordInfo; | 29 struct IE7PasswordInfo; |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 // ProfileWriter encapsulates profile for writing entries into it. | 32 // ProfileWriter encapsulates profile for writing entries into it. |
| 33 // This object must be invoked on UI thread. | 33 // This object must be invoked on UI thread. |
| 34 class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { | 34 class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { |
| 35 public: | 35 public: |
| 36 explicit ProfileWriter(Profile* profile); | 36 explicit ProfileWriter(Profile* profile); |
| 37 | 37 |
| 38 // These functions return true if the corresponding model has been loaded. | 38 // These functions return true if the corresponding model has been loaded. |
| 39 // If the models haven't been loaded, the importer waits to run until they've | 39 // If the models haven't been loaded, the importer waits to run until they've |
| 40 // completed. | 40 // completed. |
| 41 virtual bool BookmarkModelIsLoaded() const; | 41 virtual bool BookmarkModelIsLoaded() const; |
| 42 virtual bool TemplateURLServiceIsLoaded() const; | 42 virtual bool TemplateURLServiceIsLoaded() const; |
| 43 | 43 |
| 44 // Helper methods for adding data to local stores. | 44 // Helper methods for adding data to local stores. |
| 45 virtual void AddPasswordForm(const content::PasswordForm& form); | 45 virtual void AddPasswordForm(const autofill::PasswordForm& form); |
| 46 | 46 |
| 47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 48 virtual void AddIE7PasswordInfo(const IE7PasswordInfo& info); | 48 virtual void AddIE7PasswordInfo(const IE7PasswordInfo& info); |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 virtual void AddHistoryPage(const history::URLRows& page, | 51 virtual void AddHistoryPage(const history::URLRows& page, |
| 52 history::VisitSource visit_source); | 52 history::VisitSource visit_source); |
| 53 | 53 |
| 54 virtual void AddHomepage(const GURL& homepage); | 54 virtual void AddHomepage(const GURL& homepage); |
| 55 | 55 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 virtual ~ProfileWriter(); | 95 virtual ~ProfileWriter(); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 Profile* const profile_; | 98 Profile* const profile_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(ProfileWriter); | 100 DISALLOW_COPY_AND_ASSIGN(ProfileWriter); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ | 103 #endif // CHROME_BROWSER_IMPORTER_PROFILE_WRITER_H_ |
| OLD | NEW |