Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Multiply-included message file, no traditional include guard. | |
| 6 #include "googleurl/src/gurl.h" | |
| 7 #include "ipc/ipc_message.h" | |
| 8 #include "ipc/ipc_param_traits.h" | |
| 9 | |
| 10 #ifndef CHROME_COMMON_ICON_MESSAGES_H__ | |
| 11 #define CHROME_COMMON_ICON_MESSAGES_H__ | |
| 12 | |
| 13 // The icon type in a page. The definition must be same as history::IconType. | |
|
sky
2011/03/22 19:48:48
You should pull ViewHostMsg_UpdateFaviconURL into
michaelbai
2011/03/22 23:59:03
Probably not easy. Got error: redefinition of ‘cla
| |
| 14 enum IconType { | |
| 15 INVALID_ICON = 0x0, | |
| 16 FAVICON = 1 << 0, | |
| 17 TOUCH_ICON = 1 << 1, | |
| 18 TOUCH_PRECOMPOSED_ICON = 1 << 2 | |
|
sky
2011/03/22 19:48:48
Add a test that makes sure the values match.
michaelbai
2011/03/22 23:59:03
Done.
| |
| 19 }; | |
| 20 | |
| 21 // The favicon url from the render. | |
| 22 struct FaviconURL { | |
| 23 FaviconURL(); | |
| 24 FaviconURL(const GURL& url, IconType type); | |
| 25 ~FaviconURL(); | |
| 26 | |
| 27 // The url of the icon. | |
| 28 GURL icon_url; | |
| 29 | |
| 30 // The type of the icon | |
| 31 IconType icon_type; | |
| 32 }; | |
| 33 | |
| 34 namespace IPC { | |
| 35 | |
| 36 template <> | |
| 37 struct ParamTraits<IconType> { | |
| 38 typedef IconType param_type; | |
| 39 static void Write(Message* m, const param_type& p); | |
| 40 static bool Read(const Message* m, void** iter, param_type* p); | |
| 41 static void Log(const param_type& p, std::string* l); | |
| 42 }; | |
| 43 | |
| 44 template <> | |
| 45 struct ParamTraits<FaviconURL> { | |
| 46 typedef FaviconURL param_type; | |
| 47 static void Write(Message* m, const param_type& p); | |
| 48 static bool Read(const Message* m, void** iter, param_type* p); | |
| 49 static void Log(const param_type& p, std::string* l); | |
| 50 }; | |
| 51 | |
| 52 } // namespace IPC | |
| 53 | |
| 54 #endif // CHROME_COMMON_ICON_MESSAGES_H__ | |
| OLD | NEW |