| 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 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "app/clipboard/clipboard.h" | 12 #include "app/clipboard/clipboard.h" |
| 13 #include "app/gfx/native_widget_types.h" | 13 #include "app/gfx/native_widget_types.h" |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
| 17 #include "base/shared_memory.h" | 17 #include "base/shared_memory.h" |
| 18 #include "base/string16.h" | 18 #include "base/string16.h" |
| 19 #include "chrome/browser/renderer_host/resource_handler.h" | 19 #include "chrome/browser/renderer_host/resource_handler.h" |
| 20 #include "chrome/common/common_param_traits.h" | 20 #include "chrome/common/common_param_traits.h" |
| 21 #include "chrome/common/css_colors.h" | 21 #include "chrome/common/css_colors.h" |
| 22 #include "chrome/common/dom_storage_type.h" | 22 #include "chrome/common/dom_storage_common.h" |
| 23 #include "chrome/common/edit_command.h" | 23 #include "chrome/common/edit_command.h" |
| 24 #include "chrome/common/extensions/url_pattern.h" | 24 #include "chrome/common/extensions/url_pattern.h" |
| 25 #include "chrome/common/filter_policy.h" | 25 #include "chrome/common/filter_policy.h" |
| 26 #include "chrome/common/navigation_gesture.h" | 26 #include "chrome/common/navigation_gesture.h" |
| 27 #include "chrome/common/page_transition_types.h" | 27 #include "chrome/common/page_transition_types.h" |
| 28 #include "chrome/common/renderer_preferences.h" | 28 #include "chrome/common/renderer_preferences.h" |
| 29 #include "chrome/common/transport_dib.h" | 29 #include "chrome/common/transport_dib.h" |
| 30 #include "chrome/common/view_types.h" | 30 #include "chrome/common/view_types.h" |
| 31 #include "chrome/common/webkit_param_traits.h" | 31 #include "chrome/common/webkit_param_traits.h" |
| 32 #include "googleurl/src/gurl.h" | 32 #include "googleurl/src/gurl.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 // Whether the code is JavaScript or CSS. | 527 // Whether the code is JavaScript or CSS. |
| 528 bool is_javascript; | 528 bool is_javascript; |
| 529 | 529 |
| 530 // String of code to execute. | 530 // String of code to execute. |
| 531 std::string code; | 531 std::string code; |
| 532 | 532 |
| 533 // Whether to inject into all frames, or only the root frame. | 533 // Whether to inject into all frames, or only the root frame. |
| 534 bool all_frames; | 534 bool all_frames; |
| 535 }; | 535 }; |
| 536 | 536 |
| 537 // Creates a new view. |
| 538 struct ViewMsg_New_Params { |
| 539 // The parent window's id. |
| 540 gfx::NativeViewId parent_window; |
| 541 |
| 542 // Renderer-wide preferences. |
| 543 RendererPreferences renderer_preferences; |
| 544 |
| 545 // Preferences for this view. |
| 546 WebPreferences web_preferences; |
| 547 |
| 548 // This view's ID. |
| 549 int32 view_id; |
| 550 |
| 551 // The session storage namespace ID this view shoudl use. |
| 552 int64 session_storage_namespace_id; |
| 553 }; |
| 554 |
| 537 namespace IPC { | 555 namespace IPC { |
| 538 | 556 |
| 539 template <> | 557 template <> |
| 540 struct ParamTraits<ResourceType::Type> { | 558 struct ParamTraits<ResourceType::Type> { |
| 541 typedef ResourceType::Type param_type; | 559 typedef ResourceType::Type param_type; |
| 542 static void Write(Message* m, const param_type& p) { | 560 static void Write(Message* m, const param_type& p) { |
| 543 m->WriteInt(p); | 561 m->WriteInt(p); |
| 544 } | 562 } |
| 545 static bool Read(const Message* m, void** iter, param_type* p) { | 563 static bool Read(const Message* m, void** iter, param_type* p) { |
| 546 int type; | 564 int type; |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2285 struct ParamTraits<ViewMsg_ExecuteCode_Params> { | 2303 struct ParamTraits<ViewMsg_ExecuteCode_Params> { |
| 2286 typedef ViewMsg_ExecuteCode_Params param_type; | 2304 typedef ViewMsg_ExecuteCode_Params param_type; |
| 2287 static void Write(Message* m, const param_type& p) { | 2305 static void Write(Message* m, const param_type& p) { |
| 2288 WriteParam(m, p.request_id); | 2306 WriteParam(m, p.request_id); |
| 2289 WriteParam(m, p.extension_id); | 2307 WriteParam(m, p.extension_id); |
| 2290 WriteParam(m, p.host_permissions); | 2308 WriteParam(m, p.host_permissions); |
| 2291 WriteParam(m, p.is_javascript); | 2309 WriteParam(m, p.is_javascript); |
| 2292 WriteParam(m, p.code); | 2310 WriteParam(m, p.code); |
| 2293 WriteParam(m, p.all_frames); | 2311 WriteParam(m, p.all_frames); |
| 2294 } | 2312 } |
| 2295 | |
| 2296 static bool Read(const Message* m, void** iter, param_type* p) { | 2313 static bool Read(const Message* m, void** iter, param_type* p) { |
| 2297 return | 2314 return |
| 2298 ReadParam(m, iter, &p->request_id) && | 2315 ReadParam(m, iter, &p->request_id) && |
| 2299 ReadParam(m, iter, &p->extension_id) && | 2316 ReadParam(m, iter, &p->extension_id) && |
| 2300 ReadParam(m, iter, &p->host_permissions) && | 2317 ReadParam(m, iter, &p->host_permissions) && |
| 2301 ReadParam(m, iter, &p->is_javascript) && | 2318 ReadParam(m, iter, &p->is_javascript) && |
| 2302 ReadParam(m, iter, &p->code) && | 2319 ReadParam(m, iter, &p->code) && |
| 2303 ReadParam(m, iter, &p->all_frames); | 2320 ReadParam(m, iter, &p->all_frames); |
| 2304 } | 2321 } |
| 2305 static void Log(const param_type& p, std::wstring* l) { | 2322 static void Log(const param_type& p, std::wstring* l) { |
| 2306 l->append(L"<ViewMsg_ExecuteCode_Params>"); | 2323 l->append(L"<ViewMsg_ExecuteCode_Params>"); |
| 2307 } | 2324 } |
| 2308 }; | 2325 }; |
| 2309 | 2326 |
| 2327 template<> |
| 2328 struct ParamTraits<ViewMsg_New_Params> { |
| 2329 typedef ViewMsg_New_Params param_type; |
| 2330 static void Write(Message* m, const param_type& p) { |
| 2331 WriteParam(m, p.parent_window); |
| 2332 WriteParam(m, p.renderer_preferences); |
| 2333 WriteParam(m, p.web_preferences); |
| 2334 WriteParam(m, p.view_id); |
| 2335 WriteParam(m, p.session_storage_namespace_id); |
| 2336 } |
| 2337 |
| 2338 static bool Read(const Message* m, void** iter, param_type* p) { |
| 2339 return |
| 2340 ReadParam(m, iter, &p->parent_window) && |
| 2341 ReadParam(m, iter, &p->renderer_preferences) && |
| 2342 ReadParam(m, iter, &p->web_preferences) && |
| 2343 ReadParam(m, iter, &p->view_id) && |
| 2344 ReadParam(m, iter, &p->session_storage_namespace_id); |
| 2345 } |
| 2346 static void Log(const param_type& p, std::wstring* l) { |
| 2347 l->append(L"("); |
| 2348 LogParam(p.parent_window, l); |
| 2349 l->append(L", "); |
| 2350 LogParam(p.renderer_preferences, l); |
| 2351 l->append(L", "); |
| 2352 LogParam(p.web_preferences, l); |
| 2353 l->append(L", "); |
| 2354 LogParam(p.view_id, l); |
| 2355 l->append(L", "); |
| 2356 LogParam(p.session_storage_namespace_id, l); |
| 2357 l->append(L")"); |
| 2358 } |
| 2359 }; |
| 2360 |
| 2310 } // namespace IPC | 2361 } // namespace IPC |
| 2311 | 2362 |
| 2312 | 2363 |
| 2313 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 2364 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
| 2314 #include "ipc/ipc_message_macros.h" | 2365 #include "ipc/ipc_message_macros.h" |
| 2315 | 2366 |
| 2316 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 2367 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| OLD | NEW |