OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Defines messages between the browser and plugin process, as well as between | 5 // Defines messages between the browser and plugin process, as well as between |
6 // the renderer and plugin process. | 6 // the renderer and plugin process. |
7 // | 7 // |
8 // See render_message* for information about the multi-pass include of headers. | 8 // See render_message* for information about the multi-pass include of headers. |
9 | 9 |
10 #ifndef CHROME_COMMON_PLUGIN_MESSAGES_H_ | 10 #ifndef CHROME_COMMON_PLUGIN_MESSAGES_H_ |
11 #define CHROME_COMMON_PLUGIN_MESSAGES_H_ | 11 #define CHROME_COMMON_PLUGIN_MESSAGES_H_ |
12 #pragma once | 12 #pragma once |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/string_number_conversions.h" |
| 19 #include "base/utf_string_conversions.h" |
18 #include "chrome/common/common_param_traits.h" | 20 #include "chrome/common/common_param_traits.h" |
19 #include "chrome/common/webkit_param_traits.h" | 21 #include "chrome/common/webkit_param_traits.h" |
20 #include "gfx/native_widget_types.h" | 22 #include "gfx/native_widget_types.h" |
21 #include "gfx/rect.h" | 23 #include "gfx/rect.h" |
22 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
23 #include "ipc/ipc_message_utils.h" | 25 #include "ipc/ipc_message_utils.h" |
24 #include "third_party/npapi/bindings/npapi.h" | 26 #include "third_party/npapi/bindings/npapi.h" |
25 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" |
26 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
27 #include "webkit/glue/npruntime_util.h" | 29 #include "webkit/glue/npruntime_util.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 299 } |
298 static bool Read(const Message* m, void** iter, param_type* r) { | 300 static bool Read(const Message* m, void** iter, param_type* r) { |
299 return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier); | 301 return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier); |
300 } | 302 } |
301 static void Log(const param_type& p, std::wstring* l) { | 303 static void Log(const param_type& p, std::wstring* l) { |
302 if (WebKit::WebBindings::identifierIsString(p.identifier)) { | 304 if (WebKit::WebBindings::identifierIsString(p.identifier)) { |
303 NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier); | 305 NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier); |
304 l->append(UTF8ToWide(str)); | 306 l->append(UTF8ToWide(str)); |
305 NPN_MemFree(str); | 307 NPN_MemFree(str); |
306 } else { | 308 } else { |
307 l->append(IntToWString( | 309 l->append(UTF8ToWide(base::IntToString( |
308 WebKit::WebBindings::intFromIdentifier(p.identifier))); | 310 WebKit::WebBindings::intFromIdentifier(p.identifier)))); |
309 } | 311 } |
310 } | 312 } |
311 }; | 313 }; |
312 | 314 |
313 template <> | 315 template <> |
314 struct ParamTraits<NPVariant_Param> { | 316 struct ParamTraits<NPVariant_Param> { |
315 typedef NPVariant_Param param_type; | 317 typedef NPVariant_Param param_type; |
316 static void Write(Message* m, const param_type& p) { | 318 static void Write(Message* m, const param_type& p) { |
317 WriteParam(m, static_cast<int>(p.type)); | 319 WriteParam(m, static_cast<int>(p.type)); |
318 if (p.type == NPVARIANT_PARAM_BOOL) { | 320 if (p.type == NPVARIANT_PARAM_BOOL) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 427 } |
426 }; | 428 }; |
427 | 429 |
428 } // namespace IPC | 430 } // namespace IPC |
429 | 431 |
430 | 432 |
431 #define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" | 433 #define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" |
432 #include "ipc/ipc_message_macros.h" | 434 #include "ipc/ipc_message_macros.h" |
433 | 435 |
434 #endif // CHROME_COMMON_PLUGIN_MESSAGES_H_ | 436 #endif // CHROME_COMMON_PLUGIN_MESSAGES_H_ |
OLD | NEW |