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

Side by Side Diff: chrome/common/render_messages.h

Issue 3118009: Reapplies r55735, fixing some message code that was checked in that I collided with. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/render_messages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" 45 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
46 #include "webkit/appcache/appcache_interfaces.h" 46 #include "webkit/appcache/appcache_interfaces.h"
47 #include "webkit/glue/context_menu.h" 47 #include "webkit/glue/context_menu.h"
48 #include "webkit/glue/form_data.h" 48 #include "webkit/glue/form_data.h"
49 #include "webkit/glue/form_field.h" 49 #include "webkit/glue/form_field.h"
50 #include "webkit/glue/password_form.h" 50 #include "webkit/glue/password_form.h"
51 #include "webkit/glue/password_form_dom_manager.h" 51 #include "webkit/glue/password_form_dom_manager.h"
52 #include "webkit/glue/plugins/webplugin.h" 52 #include "webkit/glue/plugins/webplugin.h"
53 #include "webkit/glue/plugins/webplugininfo.h" 53 #include "webkit/glue/plugins/webplugininfo.h"
54 #include "webkit/glue/resource_loader_bridge.h" 54 #include "webkit/glue/resource_loader_bridge.h"
55 #include "webkit/glue/webaccessibility.h"
56 #include "webkit/glue/webcookie.h" 55 #include "webkit/glue/webcookie.h"
57 #include "webkit/glue/webdropdata.h" 56 #include "webkit/glue/webdropdata.h"
58 #include "webkit/glue/webmenuitem.h" 57 #include "webkit/glue/webmenuitem.h"
59 #include "webkit/glue/webpreferences.h" 58 #include "webkit/glue/webpreferences.h"
60 59
61 namespace base { 60 namespace base {
62 class Time; 61 class Time;
63 } 62 }
64 63
64 namespace webkit_glue {
65 struct WebAccessibility;
66 }
67
65 class SkBitmap; 68 class SkBitmap;
66 69
67 // Parameters structure for ViewMsg_Navigate, which has too many data 70 // Parameters structure for ViewMsg_Navigate, which has too many data
68 // parameters to be reasonably put in a predefined IPC message. 71 // parameters to be reasonably put in a predefined IPC message.
69 struct ViewMsg_Navigate_Params { 72 struct ViewMsg_Navigate_Params {
70 enum NavigationType { 73 enum NavigationType {
71 // Reload the page. 74 // Reload the page.
72 RELOAD, 75 RELOAD,
73 76
74 // Reload the page, ignoring any cache entries. 77 // Reload the page, ignoring any cache entries.
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3308 static bool Read(const Message* m, void** iter, param_type* p) { 3311 static bool Read(const Message* m, void** iter, param_type* p) {
3309 int val = 0; 3312 int val = 0;
3310 if (!ReadParam(m, iter, &val) || 3313 if (!ReadParam(m, iter, &val) ||
3311 val < WINDOW_CONTAINER_TYPE_NORMAL || 3314 val < WINDOW_CONTAINER_TYPE_NORMAL ||
3312 val >= WINDOW_CONTAINER_TYPE_MAX_VALUE) 3315 val >= WINDOW_CONTAINER_TYPE_MAX_VALUE)
3313 return false; 3316 return false;
3314 *p = static_cast<param_type>(val); 3317 *p = static_cast<param_type>(val);
3315 return true; 3318 return true;
3316 } 3319 }
3317 static void Log(const param_type& p, std::wstring* l) { 3320 static void Log(const param_type& p, std::wstring* l) {
3318 LogParam(p, l); 3321 ParamTraits<int>::Log(static_cast<int>(p), l);
3319 } 3322 }
3320 }; 3323 };
3321 3324
3322 template <> 3325 template <>
3323 struct ParamTraits<webkit_glue::WebAccessibility> { 3326 struct ParamTraits<webkit_glue::WebAccessibility> {
3324 typedef webkit_glue::WebAccessibility param_type; 3327 typedef webkit_glue::WebAccessibility param_type;
3325 static void Write(Message* m, const param_type& p) { 3328 static void Write(Message* m, const param_type& p);
3326 WriteParam(m, p.id); 3329 static bool Read(const Message* m, void** iter, param_type* p);
3327 WriteParam(m, p.name); 3330 static void Log(const param_type& p, std::wstring* l);
3328 WriteParam(m, p.value);
3329 WriteParam(m, static_cast<int>(p.role));
3330 WriteParam(m, static_cast<int>(p.state));
3331 WriteParam(m, p.location);
3332 WriteParam(m, p.attributes);
3333 WriteParam(m, p.children);
3334 }
3335 static bool Read(const Message* m, void** iter, param_type* p) {
3336 bool ret = ReadParam(m, iter, &p->id);
3337 ret = ret && ReadParam(m, iter, &p->name);
3338 ret = ret && ReadParam(m, iter, &p->value);
3339 int role = -1;
3340 ret = ret && ReadParam(m, iter, &role);
3341 if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
3342 role < webkit_glue::WebAccessibility::NUM_ROLES) {
3343 p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
3344 } else {
3345 p->role = webkit_glue::WebAccessibility::ROLE_NONE;
3346 }
3347 int state = 0;
3348 ret = ret && ReadParam(m, iter, &state);
3349 p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
3350 ret = ret && ReadParam(m, iter, &p->location);
3351 ret = ret && ReadParam(m, iter, &p->attributes);
3352 ret = ret && ReadParam(m, iter, &p->children);
3353 return ret;
3354 }
3355 static void Log(const param_type& p, std::wstring* l) {
3356 l->append(L"(");
3357 LogParam(p.id, l);
3358 l->append(L", ");
3359 LogParam(p.name, l);
3360 l->append(L", ");
3361 LogParam(p.value, l);
3362 l->append(L", ");
3363 LogParam(static_cast<int>(p.role), l);
3364 l->append(L", ");
3365 LogParam(static_cast<int>(p.state), l);
3366 l->append(L", ");
3367 LogParam(p.location, l);
3368 l->append(L", ");
3369 LogParam(p.attributes, l);
3370 l->append(L", ");
3371 LogParam(p.children, l);
3372 l->append(L")");
3373 }
3374 }; 3331 };
3375 3332
3376 // Traits for ViewMsg_DeviceOrientationUpdated_Params 3333 // Traits for ViewMsg_DeviceOrientationUpdated_Params
3377 // structure to pack/unpack. 3334 // structure to pack/unpack.
3378 template <> 3335 template <>
3379 struct ParamTraits<ViewMsg_DeviceOrientationUpdated_Params> { 3336 struct ParamTraits<ViewMsg_DeviceOrientationUpdated_Params> {
3380 typedef ViewMsg_DeviceOrientationUpdated_Params param_type; 3337 typedef ViewMsg_DeviceOrientationUpdated_Params param_type;
3381 static void Write(Message* m, const param_type& p) { 3338 static void Write(Message* m, const param_type& p) {
3382 WriteParam(m, p.can_provide_alpha); 3339 WriteParam(m, p.can_provide_alpha);
3383 WriteParam(m, p.alpha); 3340 WriteParam(m, p.alpha);
(...skipping 26 matching lines...) Expand all
3410 LogParam(p.gamma, l); 3367 LogParam(p.gamma, l);
3411 l->append(L")"); 3368 l->append(L")");
3412 } 3369 }
3413 }; 3370 };
3414 } // namespace IPC 3371 } // namespace IPC
3415 3372
3416 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 3373 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
3417 #include "ipc/ipc_message_macros.h" 3374 #include "ipc/ipc_message_macros.h"
3418 3375
3419 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 3376 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/render_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698