| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_EXTERNAL_PROCESS_IMPORTER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_CLIENT_H_ | 6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // |total_bookmarks_count| is the total number of bookmarks to be imported. | 84 // |total_bookmarks_count| is the total number of bookmarks to be imported. |
| 85 virtual void OnBookmarksImportStart(const std::wstring first_folder_name, | 85 virtual void OnBookmarksImportStart(const std::wstring first_folder_name, |
| 86 int options, | 86 int options, |
| 87 size_t total_bookmarks_count) OVERRIDE; | 87 size_t total_bookmarks_count) OVERRIDE; |
| 88 | 88 |
| 89 // Called when a group of bookmarks has been received. | 89 // Called when a group of bookmarks has been received. |
| 90 virtual void OnBookmarksImportGroup( | 90 virtual void OnBookmarksImportGroup( |
| 91 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks_group) | 91 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks_group) |
| 92 OVERRIDE; | 92 OVERRIDE; |
| 93 | 93 |
| 94 // First message received when importing favicons. |total_fav_icons_size| | 94 // First message received when importing favicons. |total_favicons_size| |
| 95 // gives the total number of favicons to be imported. | 95 // gives the total number of favicons to be imported. |
| 96 virtual void OnFavIconsImportStart(size_t total_fav_icons_count) OVERRIDE; | 96 virtual void OnFavIconsImportStart(size_t total_favicons_count) OVERRIDE; |
| 97 | 97 |
| 98 // Called when a group of favicons has been received. | 98 // Called when a group of favicons has been received. |
| 99 virtual void OnFavIconsImportGroup( | 99 virtual void OnFavIconsImportGroup( |
| 100 const std::vector<history::ImportedFavIconUsage>& fav_icons_group) | 100 const std::vector<history::ImportedFavIconUsage>& favicons_group) |
| 101 OVERRIDE; | 101 OVERRIDE; |
| 102 | 102 |
| 103 // Called when the passwordform has been received. | 103 // Called when the passwordform has been received. |
| 104 virtual void OnPasswordFormImportReady( | 104 virtual void OnPasswordFormImportReady( |
| 105 const webkit_glue::PasswordForm& form) OVERRIDE; | 105 const webkit_glue::PasswordForm& form) OVERRIDE; |
| 106 | 106 |
| 107 // Called when search engines have been received. | 107 // Called when search engines have been received. |
| 108 virtual void OnKeywordsImportReady( | 108 virtual void OnKeywordsImportReady( |
| 109 const std::vector<TemplateURL>& template_urls, | 109 const std::vector<TemplateURL>& template_urls, |
| 110 int default_keyword_index, | 110 int default_keyword_index, |
| 111 bool unique_on_host_and_path) OVERRIDE; | 111 bool unique_on_host_and_path) OVERRIDE; |
| 112 | 112 |
| 113 // End ProfileImportProcessHost::ImportProcessClient implementation. | 113 // End ProfileImportProcessHost::ImportProcessClient implementation. |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 // These variables store data being collected from the importer until the | 116 // These variables store data being collected from the importer until the |
| 117 // entire group has been collected and is ready to be written to the profile. | 117 // entire group has been collected and is ready to be written to the profile. |
| 118 std::vector<history::URLRow> history_rows_; | 118 std::vector<history::URLRow> history_rows_; |
| 119 std::vector<ProfileWriter::BookmarkEntry> bookmarks_; | 119 std::vector<ProfileWriter::BookmarkEntry> bookmarks_; |
| 120 std::vector<history::ImportedFavIconUsage> fav_icons_; | 120 std::vector<history::ImportedFavIconUsage> favicons_; |
| 121 | 121 |
| 122 // Usually some variation on IDS_BOOKMARK_GROUP_...; the name of the folder | 122 // Usually some variation on IDS_BOOKMARK_GROUP_...; the name of the folder |
| 123 // under which imported bookmarks will be placed. | 123 // under which imported bookmarks will be placed. |
| 124 std::wstring bookmarks_first_folder_name_; | 124 std::wstring bookmarks_first_folder_name_; |
| 125 | 125 |
| 126 // Determines how bookmarks should be added (ProfileWriter::BookmarkOptions). | 126 // Determines how bookmarks should be added (ProfileWriter::BookmarkOptions). |
| 127 int bookmarks_options_; | 127 int bookmarks_options_; |
| 128 | 128 |
| 129 // Total number of bookmarks to import. | 129 // Total number of bookmarks to import. |
| 130 size_t total_bookmarks_count_; | 130 size_t total_bookmarks_count_; |
| 131 | 131 |
| 132 // Total number of history items to import. | 132 // Total number of history items to import. |
| 133 size_t total_history_rows_count_; | 133 size_t total_history_rows_count_; |
| 134 | 134 |
| 135 // Total number of favicons to import. | 135 // Total number of favicons to import. |
| 136 size_t total_fav_icons_count_; | 136 size_t total_favicons_count_; |
| 137 | 137 |
| 138 // Notifications received from the ProfileImportProcessHost are passed back | 138 // Notifications received from the ProfileImportProcessHost are passed back |
| 139 // to process_importer_host_, which calls the ProfileWriter to record the | 139 // to process_importer_host_, which calls the ProfileWriter to record the |
| 140 // import data. When the import process is done, process_importer_host_ | 140 // import data. When the import process is done, process_importer_host_ |
| 141 // deletes itself. | 141 // deletes itself. |
| 142 ExternalProcessImporterHost* process_importer_host_; | 142 ExternalProcessImporterHost* process_importer_host_; |
| 143 | 143 |
| 144 // Handles sending messages to the external process. Deletes itself when | 144 // Handles sending messages to the external process. Deletes itself when |
| 145 // the external process dies (see ChildProcessHost::OnChildDied). | 145 // the external process dies (see ChildProcessHost::OnChildDied). |
| 146 ProfileImportProcessHost* profile_import_process_host_; | 146 ProfileImportProcessHost* profile_import_process_host_; |
| 147 | 147 |
| 148 // Data to be passed from the importer host to the external importer. | 148 // Data to be passed from the importer host to the external importer. |
| 149 const importer::ProfileInfo& profile_info_; | 149 const importer::ProfileInfo& profile_info_; |
| 150 uint16 items_; | 150 uint16 items_; |
| 151 bool import_to_bookmark_bar_; | 151 bool import_to_bookmark_bar_; |
| 152 | 152 |
| 153 // Takes import data coming over IPC and delivers it to be written by the | 153 // Takes import data coming over IPC and delivers it to be written by the |
| 154 // ProfileWriter. Released by ExternalProcessImporterClient in its | 154 // ProfileWriter. Released by ExternalProcessImporterClient in its |
| 155 // destructor. | 155 // destructor. |
| 156 InProcessImporterBridge* bridge_; | 156 InProcessImporterBridge* bridge_; |
| 157 | 157 |
| 158 // True if import process has been cancelled. | 158 // True if import process has been cancelled. |
| 159 bool cancelled_; | 159 bool cancelled_; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterClient); | 161 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterClient); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_CLIENT_H_ | 164 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_CLIENT_H_ |
| OLD | NEW |