Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8053)

Unified Diff: chrome/common/render_messages.h

Issue 159471: Merge 21466 - Allow the browser to send actions back to the render for media ... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/render_messages.h
===================================================================
--- chrome/common/render_messages.h (revision 21785)
+++ chrome/common/render_messages.h (working copy)
@@ -520,8 +520,8 @@
};
template <>
-struct ParamTraits<ContextNode> {
- typedef ContextNode param_type;
+struct ParamTraits<ContextNodeType> {
+ typedef ContextNodeType param_type;
static void Write(Message* m, const param_type& p) {
m->WriteInt(p.type);
}
@@ -529,7 +529,7 @@
int type;
if (!m->ReadInt(iter, &type))
return false;
- *p = ContextNode(type);
+ *p = ContextNodeType(type);
return true;
}
static void Log(const param_type& p, std::wstring* l) {
@@ -539,19 +539,19 @@
event.append(L"NONE");
} else {
event.append(L"(");
- if (p.type & ContextNode::PAGE)
+ if (p.type & ContextNodeType::PAGE)
event.append(L"PAGE|");
- if (p.type & ContextNode::FRAME)
+ if (p.type & ContextNodeType::FRAME)
event.append(L"FRAME|");
- if (p.type & ContextNode::LINK)
+ if (p.type & ContextNodeType::LINK)
event.append(L"LINK|");
- if (p.type & ContextNode::IMAGE)
+ if (p.type & ContextNodeType::IMAGE)
event.append(L"IMAGE|");
- if (p.type & ContextNode::SELECTION)
+ if (p.type & ContextNodeType::SELECTION)
event.append(L"SELECTION|");
- if (p.type & ContextNode::EDITABLE)
+ if (p.type & ContextNodeType::EDITABLE)
event.append(L"EDITABLE|");
- if (p.type & ContextNode::MISSPELLED_WORD)
+ if (p.type & ContextNodeType::MISSPELLED_WORD)
event.append(L"MISSPELLED_WORD|");
event.append(L")");
}
@@ -874,7 +874,7 @@
struct ParamTraits<ContextMenuParams> {
typedef ContextMenuParams param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.node);
+ WriteParam(m, p.node_type);
WriteParam(m, p.x);
WriteParam(m, p.y);
WriteParam(m, p.link_url);
@@ -893,7 +893,7 @@
}
static bool Read(const Message* m, void** iter, param_type* p) {
return
- ReadParam(m, iter, &p->node) &&
+ ReadParam(m, iter, &p->node_type) &&
ReadParam(m, iter, &p->x) &&
ReadParam(m, iter, &p->y) &&
ReadParam(m, iter, &p->link_url) &&
@@ -915,6 +915,46 @@
}
};
+template <>
+struct ParamTraits<MediaPlayerAction> {
+ typedef MediaPlayerAction param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.command);
+ WriteParam(m, p.playback_rate);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->command) &&
+ ReadParam(m, iter, &p->playback_rate);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ std::wstring event = L"";
+ if (!p.command) {
+ l->append(L"NONE");
+ } else {
+ l->append(L"(");
+ if (p.command & MediaPlayerAction::PLAY)
+ l->append(L"PLAY|");
+ if (p.command & MediaPlayerAction::PAUSE)
+ l->append(L"PAUSE|");
+ if (p.command & MediaPlayerAction::MUTE)
+ l->append(L"MUTE|");
+ if (p.command & MediaPlayerAction::UNMUTE)
+ l->append(L"UNMUTE|");
+ if (p.command & MediaPlayerAction::LOOP)
+ l->append(L"LOOP|");
+ if (p.command & MediaPlayerAction::NO_LOOP)
+ l->append(L"NO_LOOP|");
+ if (p.command & MediaPlayerAction::SET_PLAYBACK_RATE) {
+ l->append(L"SET_PLAYBACK_RATE [");
+ LogParam(p.playback_rate, l);
+ l->append(L"]|");
+ }
+ l->append(L")");
+ }
+ }
+};
+
// Traits for ViewHostMsg_PaintRect_Params structure to pack/unpack.
template <>
struct ParamTraits<ViewHostMsg_PaintRect_Params> {
Property changes on: chrome\common\render_messages.h
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/common/render_messages.h:r21466
« no previous file with comments | « chrome/browser/views/tab_contents/render_view_context_menu_win.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698