diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/render_messages.h | 65 | ||||
-rw-r--r-- | chrome/common/webkit_param_traits.h | 15 |
2 files changed, 21 insertions, 59 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 5a6b335..59dc1ac 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -557,47 +557,6 @@ struct ParamTraits<FilterPolicy::Type> { }; template <> -struct ParamTraits<ContextNodeType> { - typedef ContextNodeType param_type; - static void Write(Message* m, const param_type& p) { - m->WriteInt(p.type); - } - static bool Read(const Message* m, void** iter, param_type* p) { - int type; - if (!m->ReadInt(iter, &type)) - return false; - *p = ContextNodeType(type); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - std::wstring event = L""; - - if (!p.type) { - event.append(L"NONE"); - } else { - event.append(L"("); - if (p.type & ContextNodeType::PAGE) - event.append(L"PAGE|"); - if (p.type & ContextNodeType::FRAME) - event.append(L"FRAME|"); - if (p.type & ContextNodeType::LINK) - event.append(L"LINK|"); - if (p.type & ContextNodeType::IMAGE) - event.append(L"IMAGE|"); - if (p.type & ContextNodeType::SELECTION) - event.append(L"SELECTION|"); - if (p.type & ContextNodeType::EDITABLE) - event.append(L"EDITABLE|"); - if (p.type & ContextNodeType::MISSPELLED_WORD) - event.append(L"MISSPELLED_WORD|"); - event.append(L")"); - } - - LogParam(event, l); - } -}; - -template <> struct ParamTraits<webkit_glue::WebAccessibility::InParams> { typedef webkit_glue::WebAccessibility::InParams param_type; static void Write(Message* m, const param_type& p) { @@ -894,24 +853,10 @@ struct ParamTraits<ViewHostMsg_FrameNavigate_Params> { }; template <> -struct ParamTraits<ContextMenuMediaParams> { - typedef ContextMenuMediaParams param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.player_state); - WriteParam(m, p.has_audio); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->player_state) && - ReadParam(m, iter, &p->has_audio); - } -}; - -template <> struct ParamTraits<ContextMenuParams> { typedef ContextMenuParams param_type; static void Write(Message* m, const param_type& p) { - WriteParam(m, p.node_type); + WriteParam(m, p.media_type); WriteParam(m, p.x); WriteParam(m, p.y); WriteParam(m, p.link_url); @@ -919,18 +864,19 @@ struct ParamTraits<ContextMenuParams> { WriteParam(m, p.src_url); WriteParam(m, p.page_url); WriteParam(m, p.frame_url); - WriteParam(m, p.media_params); + WriteParam(m, p.media_flags); WriteParam(m, p.selection_text); WriteParam(m, p.misspelled_word); WriteParam(m, p.dictionary_suggestions); WriteParam(m, p.spellcheck_enabled); + WriteParam(m, p.is_editable); WriteParam(m, p.edit_flags); WriteParam(m, p.security_info); WriteParam(m, p.frame_charset); } static bool Read(const Message* m, void** iter, param_type* p) { return - ReadParam(m, iter, &p->node_type) && + ReadParam(m, iter, &p->media_type) && ReadParam(m, iter, &p->x) && ReadParam(m, iter, &p->y) && ReadParam(m, iter, &p->link_url) && @@ -938,11 +884,12 @@ struct ParamTraits<ContextMenuParams> { ReadParam(m, iter, &p->src_url) && ReadParam(m, iter, &p->page_url) && ReadParam(m, iter, &p->frame_url) && - ReadParam(m, iter, &p->media_params) && + ReadParam(m, iter, &p->media_flags) && ReadParam(m, iter, &p->selection_text) && ReadParam(m, iter, &p->misspelled_word) && ReadParam(m, iter, &p->dictionary_suggestions) && ReadParam(m, iter, &p->spellcheck_enabled) && + ReadParam(m, iter, &p->is_editable) && ReadParam(m, iter, &p->edit_flags) && ReadParam(m, iter, &p->security_info) && ReadParam(m, iter, &p->frame_charset); diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h index 8a32741..dacaf08 100644 --- a/chrome/common/webkit_param_traits.h +++ b/chrome/common/webkit_param_traits.h @@ -27,6 +27,7 @@ #include "webkit/api/public/WebCache.h" #include "webkit/api/public/WebCompositionCommand.h" #include "webkit/api/public/WebConsoleMessage.h" +#include "webkit/api/public/WebContextMenuData.h" #include "webkit/api/public/WebDragOperation.h" #include "webkit/api/public/WebFindOptions.h" #include "webkit/api/public/WebInputEvent.h" @@ -357,6 +358,20 @@ struct ParamTraits<WebKit::WebMediaPlayerAction> { } }; +template <> + struct ParamTraits<WebKit::WebContextMenuData::MediaType> { + typedef WebKit::WebContextMenuData::MediaType param_type; + static void Write(Message* m, const param_type& p) { + m->WriteInt(p); + } + static bool Read(const Message* m, void** iter, param_type* r) { + int temp; + bool res = m->ReadInt(iter, &temp); + *r = static_cast<param_type>(temp); + return res; + } +}; + } // namespace IPC #endif // CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ |