| 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 #include "chrome/common/render_messages_params.h" | |
| 6 | |
| 7 #include "chrome/common/render_messages.h" | |
| 8 | |
| 9 namespace IPC { | |
| 10 | |
| 11 void ParamTraits<ViewHostMsg_PageHasOSDD_Type>::Write(Message* m, | |
| 12 const param_type& p) { | |
| 13 m->WriteInt(p.type); | |
| 14 } | |
| 15 | |
| 16 bool ParamTraits<ViewHostMsg_PageHasOSDD_Type>::Read(const Message* m, | |
| 17 void** iter, | |
| 18 param_type* p) { | |
| 19 int type; | |
| 20 if (!m->ReadInt(iter, &type)) | |
| 21 return false; | |
| 22 p->type = static_cast<param_type::Type>(type); | |
| 23 return true; | |
| 24 } | |
| 25 | |
| 26 void ParamTraits<ViewHostMsg_PageHasOSDD_Type>::Log(const param_type& p, | |
| 27 std::string* l) { | |
| 28 std::string type; | |
| 29 switch (p.type) { | |
| 30 case ViewHostMsg_PageHasOSDD_Type::AUTODETECTED_PROVIDER: | |
| 31 type = "ViewHostMsg_PageHasOSDD_Type::AUTODETECTED_PROVIDER"; | |
| 32 break; | |
| 33 case ViewHostMsg_PageHasOSDD_Type::EXPLICIT_PROVIDER: | |
| 34 type = "ViewHostMsg_PageHasOSDD_Type::EXPLICIT_PROVIDER"; | |
| 35 break; | |
| 36 case ViewHostMsg_PageHasOSDD_Type::EXPLICIT_DEFAULT_PROVIDER: | |
| 37 type = "ViewHostMsg_PageHasOSDD_Type::EXPLICIT_DEFAULT_PROVIDER"; | |
| 38 break; | |
| 39 default: | |
| 40 type = "UNKNOWN"; | |
| 41 break; | |
| 42 } | |
| 43 LogParam(type, l); | |
| 44 } | |
| 45 | |
| 46 void ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params>::Write( | |
| 47 Message* m, const param_type& p) { | |
| 48 m->WriteInt(p.state); | |
| 49 } | |
| 50 | |
| 51 bool ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params>::Read( | |
| 52 const Message* m, void** iter, param_type* p) { | |
| 53 int type; | |
| 54 if (!m->ReadInt(iter, &type)) | |
| 55 return false; | |
| 56 p->state = static_cast<param_type::State>(type); | |
| 57 return true; | |
| 58 } | |
| 59 | |
| 60 void ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params>::Log( | |
| 61 const param_type& p, std::string* l) { | |
| 62 std::string state; | |
| 63 switch (p.state) { | |
| 64 case ViewHostMsg_GetSearchProviderInstallState_Params::DENIED: | |
| 65 state = "ViewHostMsg_GetSearchProviderInstallState_Params::DENIED"; | |
| 66 break; | |
| 67 case ViewHostMsg_GetSearchProviderInstallState_Params::NOT_INSTALLED: | |
| 68 state = | |
| 69 "ViewHostMsg_GetSearchProviderInstallState_Params::NOT_INSTALLED"; | |
| 70 break; | |
| 71 case ViewHostMsg_GetSearchProviderInstallState_Params:: | |
| 72 INSTALLED_BUT_NOT_DEFAULT: | |
| 73 state = "ViewHostMsg_GetSearchProviderInstallState_Params::" | |
| 74 "INSTALLED_BUT_NOT_DEFAULT"; | |
| 75 break; | |
| 76 case ViewHostMsg_GetSearchProviderInstallState_Params:: | |
| 77 INSTALLED_AS_DEFAULT: | |
| 78 state = "ViewHostMsg_GetSearchProviderInstallState_Params::" | |
| 79 "INSTALLED_AS_DEFAULT"; | |
| 80 break; | |
| 81 default: | |
| 82 state = "UNKNOWN"; | |
| 83 break; | |
| 84 } | |
| 85 LogParam(state, l); | |
| 86 } | |
| 87 | |
| 88 } // namespace IPC | |
| OLD | NEW |