| 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 // Multiply-included message file, no traditonal include guard. | 5 // Multiply-included message file, no traditonal include guard. |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" |
| 12 #include "chrome/browser/history/history_types.h" | 13 #include "chrome/browser/history/history_types.h" |
| 13 #include "chrome/browser/importer/importer_data_types.h" | 14 #include "chrome/browser/importer/importer_data_types.h" |
| 14 #include "chrome/browser/importer/profile_writer.h" | |
| 15 #include "chrome/browser/search_engines/template_url.h" | 15 #include "chrome/browser/search_engines/template_url.h" |
| 16 #include "chrome/common/common_param_traits_macros.h" | 16 #include "chrome/common/common_param_traits_macros.h" |
| 17 #include "content/public/common/common_param_traits.h" | 17 #include "content/public/common/common_param_traits.h" |
| 18 #include "content/public/common/password_form.h" | 18 #include "content/public/common/password_form.h" |
| 19 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
| 20 #include "ipc/ipc_message_utils.h" | 20 #include "ipc/ipc_message_utils.h" |
| 21 | 21 |
| 22 #ifndef CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ | 22 #ifndef CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ |
| 23 #define CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ | 23 #define CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ |
| 24 | 24 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 l->append(", "); | 118 l->append(", "); |
| 119 LogParam(p.typed_count(), l); | 119 LogParam(p.typed_count(), l); |
| 120 l->append(", "); | 120 l->append(", "); |
| 121 LogParam(p.last_visit(), l); | 121 LogParam(p.last_visit(), l); |
| 122 l->append(", "); | 122 l->append(", "); |
| 123 LogParam(p.hidden(), l); | 123 LogParam(p.hidden(), l); |
| 124 l->append(")"); | 124 l->append(")"); |
| 125 } | 125 } |
| 126 }; // ParamTraits<history::URLRow> | 126 }; // ParamTraits<history::URLRow> |
| 127 | 127 |
| 128 // Traits for ProfileWriter::BookmarkEntry to pack/unpack. | 128 // Traits for ImportedBookmarkEntry to pack/unpack. |
| 129 template <> | 129 template <> |
| 130 struct ParamTraits<ProfileWriter::BookmarkEntry> { | 130 struct ParamTraits<ImportedBookmarkEntry> { |
| 131 typedef ProfileWriter::BookmarkEntry param_type; | 131 typedef ImportedBookmarkEntry param_type; |
| 132 static void Write(Message* m, const param_type& p) { | 132 static void Write(Message* m, const param_type& p) { |
| 133 WriteParam(m, p.in_toolbar); | 133 WriteParam(m, p.in_toolbar); |
| 134 WriteParam(m, p.is_folder); | 134 WriteParam(m, p.is_folder); |
| 135 WriteParam(m, p.url); | 135 WriteParam(m, p.url); |
| 136 WriteParam(m, p.path); | 136 WriteParam(m, p.path); |
| 137 WriteParam(m, p.title); | 137 WriteParam(m, p.title); |
| 138 WriteParam(m, p.creation_time); | 138 WriteParam(m, p.creation_time); |
| 139 } | 139 } |
| 140 static bool Read(const Message* m, PickleIterator* iter, param_type* p) { | 140 static bool Read(const Message* m, PickleIterator* iter, param_type* p) { |
| 141 return | 141 return |
| (...skipping 12 matching lines...) Expand all Loading... |
| 154 l->append(", "); | 154 l->append(", "); |
| 155 LogParam(p.url, l); | 155 LogParam(p.url, l); |
| 156 l->append(", "); | 156 l->append(", "); |
| 157 LogParam(p.path, l); | 157 LogParam(p.path, l); |
| 158 l->append(", "); | 158 l->append(", "); |
| 159 LogParam(p.title, l); | 159 LogParam(p.title, l); |
| 160 l->append(", "); | 160 l->append(", "); |
| 161 LogParam(p.creation_time, l); | 161 LogParam(p.creation_time, l); |
| 162 l->append(")"); | 162 l->append(")"); |
| 163 } | 163 } |
| 164 }; // ParamTraits<ProfileWriter::BookmarkEntry> | 164 }; // ParamTraits<ImportedBookmarkEntry> |
| 165 | 165 |
| 166 // Traits for history::ImportedFaviconUsage. | 166 // Traits for history::ImportedFaviconUsage. |
| 167 template <> | 167 template <> |
| 168 struct ParamTraits<history::ImportedFaviconUsage> { | 168 struct ParamTraits<history::ImportedFaviconUsage> { |
| 169 typedef history::ImportedFaviconUsage param_type; | 169 typedef history::ImportedFaviconUsage param_type; |
| 170 static void Write(Message* m, const param_type& p) { | 170 static void Write(Message* m, const param_type& p) { |
| 171 WriteParam(m, p.favicon_url); | 171 WriteParam(m, p.favicon_url); |
| 172 WriteParam(m, p.png_data); | 172 WriteParam(m, p.png_data); |
| 173 WriteParam(m, p.urls); | 173 WriteParam(m, p.urls); |
| 174 } | 174 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 /* To simplify IPC call, pass as an integer */) | 315 /* To simplify IPC call, pass as an integer */) |
| 316 | 316 |
| 317 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyHomePageImportReady, | 317 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyHomePageImportReady, |
| 318 GURL /* GURL of home page */) | 318 GURL /* GURL of home page */) |
| 319 | 319 |
| 320 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyBookmarksImportStart, | 320 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyBookmarksImportStart, |
| 321 string16 /* first folder name */, | 321 string16 /* first folder name */, |
| 322 int /* total number of bookmarks */) | 322 int /* total number of bookmarks */) |
| 323 | 323 |
| 324 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyBookmarksImportGroup, | 324 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyBookmarksImportGroup, |
| 325 std::vector<ProfileWriter::BookmarkEntry>) | 325 std::vector<ImportedBookmarkEntry>) |
| 326 | 326 |
| 327 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFaviconsImportStart, | 327 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFaviconsImportStart, |
| 328 int /* total number of favicons */) | 328 int /* total number of favicons */) |
| 329 | 329 |
| 330 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFaviconsImportGroup, | 330 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFaviconsImportGroup, |
| 331 std::vector<history::ImportedFaviconUsage>) | 331 std::vector<history::ImportedFaviconUsage>) |
| 332 | 332 |
| 333 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, | 333 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, |
| 334 content::PasswordForm) | 334 content::PasswordForm) |
| 335 | 335 |
| 336 // WARNING: The TemplateURL*s in the following message get heap-allocated on the | 336 // WARNING: The TemplateURL*s in the following message get heap-allocated on the |
| 337 // receiving end. The message handler for this message MUST take ownership of | 337 // receiving end. The message handler for this message MUST take ownership of |
| 338 // these pointers and ensure they're properly freed! | 338 // these pointers and ensure they're properly freed! |
| 339 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady, | 339 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady, |
| 340 std::vector<TemplateURL*>, | 340 std::vector<TemplateURL*>, |
| 341 bool /* unique on host and path */) | 341 bool /* unique on host and path */) |
| OLD | NEW |