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

Unified Diff: chrome/common/webkit_param_traits.h

Issue 251103: Move MediaPlayerAction to WebMediaPlayerAction. Switch to an enum and a... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/webkit_param_traits.h
===================================================================
--- chrome/common/webkit_param_traits.h (revision 28235)
+++ chrome/common/webkit_param_traits.h (working copy)
@@ -30,6 +30,7 @@
#include "webkit/api/public/WebDragOperation.h"
#include "webkit/api/public/WebFindOptions.h"
#include "webkit/api/public/WebInputEvent.h"
+#include "webkit/api/public/WebMediaPlayerAction.h"
#include "webkit/api/public/WebScreenInfo.h"
#include "webkit/api/public/WebTextDirection.h"
@@ -304,7 +305,7 @@
};
template <>
- struct ParamTraits<WebKit::WebDragOperation> {
+struct ParamTraits<WebKit::WebDragOperation> {
typedef WebKit::WebDragOperation param_type;
static void Write(Message* m, const param_type& p) {
m->WriteInt(p);
@@ -320,6 +321,42 @@
}
};
+template <>
+struct ParamTraits<WebKit::WebMediaPlayerAction> {
+ typedef WebKit::WebMediaPlayerAction param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, static_cast<int>(p.type));
+ WriteParam(m, p.enable);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ int temp;
+ if (!ReadParam(m, iter, &temp))
+ return false;
+ r->type = static_cast<param_type::Type>(temp);
+ return ReadParam(m, iter, &r->enable);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ switch (p.type) {
+ case WebKit::WebMediaPlayerAction::Play:
+ l->append(L"Play");
+ break;
+ case WebKit::WebMediaPlayerAction::Mute:
+ l->append(L"Mute");
+ break;
+ case WebKit::WebMediaPlayerAction::Loop:
+ l->append(L"Loop");
+ break;
+ default:
+ l->append(L"Unknown");
+ break;
+ }
+ l->append(L", ");
+ LogParam(p.enable, l);
+ l->append(L")");
+ }
+};
+
} // namespace IPC
#endif // CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698