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" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 template <> | 254 template <> |
255 struct ParamTraits<TemplateURL*> { | 255 struct ParamTraits<TemplateURL*> { |
256 typedef TemplateURL* param_type; | 256 typedef TemplateURL* param_type; |
257 static void Write(Message* m, const param_type& p) { | 257 static void Write(Message* m, const param_type& p) { |
258 WriteParam(m, p->data()); | 258 WriteParam(m, p->data()); |
259 } | 259 } |
260 static bool Read(const Message* m, PickleIterator* iter, param_type* p) { | 260 static bool Read(const Message* m, PickleIterator* iter, param_type* p) { |
261 TemplateURLData data; | 261 TemplateURLData data; |
262 if (!ReadParam(m, iter, &data)) | 262 if (!ReadParam(m, iter, &data)) |
263 return false; | 263 return false; |
264 *p = new TemplateURL(data); | 264 // Since we don't have access to a Profile*, just supply NULL. The caller |
| 265 // can create a new TemplateURL or modify this one (e.g. via |
| 266 // TemplateURLService::AddAndSetProfile()) to correct this later. |
| 267 *p = new TemplateURL(NULL, data); |
265 return true; | 268 return true; |
266 } | 269 } |
267 static void Log(const param_type& p, std::string* l) { | 270 static void Log(const param_type& p, std::string* l) { |
268 l->append("<TemplateURL*>"); | 271 l->append("<TemplateURL*>"); |
269 } | 272 } |
270 }; | 273 }; |
271 | 274 |
272 } // namespace IPC | 275 } // namespace IPC |
273 | 276 |
274 #endif // CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ | 277 #endif // CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 336 |
334 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, | 337 IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, |
335 webkit::forms::PasswordForm) | 338 webkit::forms::PasswordForm) |
336 | 339 |
337 // WARNING: The TemplateURL*s in the following message get heap-allocated on the | 340 // WARNING: The TemplateURL*s in the following message get heap-allocated on the |
338 // receiving end. The message handler for this message MUST take ownership of | 341 // receiving end. The message handler for this message MUST take ownership of |
339 // these pointers and ensure they're properly freed! | 342 // these pointers and ensure they're properly freed! |
340 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady, | 343 IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady, |
341 std::vector<TemplateURL*>, | 344 std::vector<TemplateURL*>, |
342 bool /* unique on host and path */) | 345 bool /* unique on host and path */) |
OLD | NEW |