| OLD | NEW |
| 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 #include "chrome/common/common_param_traits.h" | 5 #include "chrome/common/common_param_traits.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "chrome/common/chrome_constants.h" | 8 #include "chrome/common/chrome_constants.h" |
| 9 #include "chrome/common/content_settings.h" | 9 #include "chrome/common/content_settings.h" |
| 10 #include "chrome/common/geoposition.h" | 10 #include "chrome/common/geoposition.h" |
| 11 #include "chrome/common/thumbnail_score.h" | 11 #include "chrome/common/thumbnail_score.h" |
| 12 #include "chrome/common/web_apps.h" |
| 12 #include "gfx/rect.h" | 13 #include "gfx/rect.h" |
| 13 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 14 #include "net/base/upload_data.h" | 15 #include "net/base/upload_data.h" |
| 15 #include "printing/native_metafile.h" | 16 #include "printing/native_metafile.h" |
| 16 #include "printing/page_range.h" | 17 #include "printing/page_range.h" |
| 17 | 18 |
| 18 #ifndef EXCLUDE_SKIA_DEPENDENCIES | 19 #ifndef EXCLUDE_SKIA_DEPENDENCIES |
| 19 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 20 #endif | 21 #endif |
| 21 #include "webkit/glue/dom_operations.h" | |
| 22 #include "webkit/glue/password_form.h" | 22 #include "webkit/glue/password_form.h" |
| 23 | 23 |
| 24 namespace IPC { | 24 namespace IPC { |
| 25 | 25 |
| 26 #ifndef EXCLUDE_SKIA_DEPENDENCIES | 26 #ifndef EXCLUDE_SKIA_DEPENDENCIES |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 struct SkBitmap_Data { | 30 struct SkBitmap_Data { |
| 31 // The configuration for the bitmap (bits per pixel, etc). | 31 // The configuration for the bitmap (bits per pixel, etc). |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return false; | 220 return false; |
| 221 } | 221 } |
| 222 return true; | 222 return true; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void ParamTraits<ContentSettings>::Log( | 225 void ParamTraits<ContentSettings>::Log( |
| 226 const ContentSettings& p, std::string* l) { | 226 const ContentSettings& p, std::string* l) { |
| 227 l->append("<ContentSettings>"); | 227 l->append("<ContentSettings>"); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void ParamTraits<webkit_glue::WebApplicationInfo>::Write( | 230 void ParamTraits<WebApplicationInfo>::Write(Message* m, |
| 231 Message* m, const webkit_glue::WebApplicationInfo& p) { | 231 const WebApplicationInfo& p) { |
| 232 WriteParam(m, p.title); | 232 WriteParam(m, p.title); |
| 233 WriteParam(m, p.description); | 233 WriteParam(m, p.description); |
| 234 WriteParam(m, p.app_url); | 234 WriteParam(m, p.app_url); |
| 235 WriteParam(m, p.icons.size()); | 235 WriteParam(m, p.icons.size()); |
| 236 for (size_t i = 0; i < p.icons.size(); ++i) { | 236 for (size_t i = 0; i < p.icons.size(); ++i) { |
| 237 WriteParam(m, p.icons[i].url); | 237 WriteParam(m, p.icons[i].url); |
| 238 WriteParam(m, p.icons[i].width); | 238 WriteParam(m, p.icons[i].width); |
| 239 WriteParam(m, p.icons[i].height); | 239 WriteParam(m, p.icons[i].height); |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 | 242 |
| 243 bool ParamTraits<webkit_glue::WebApplicationInfo>::Read( | 243 bool ParamTraits<WebApplicationInfo>::Read( |
| 244 const Message* m, void** iter, webkit_glue::WebApplicationInfo* r) { | 244 const Message* m, void** iter, WebApplicationInfo* r) { |
| 245 size_t icon_count; | 245 size_t icon_count; |
| 246 bool result = | 246 bool result = |
| 247 ReadParam(m, iter, &r->title) && | 247 ReadParam(m, iter, &r->title) && |
| 248 ReadParam(m, iter, &r->description) && | 248 ReadParam(m, iter, &r->description) && |
| 249 ReadParam(m, iter, &r->app_url) && | 249 ReadParam(m, iter, &r->app_url) && |
| 250 ReadParam(m, iter, &icon_count); | 250 ReadParam(m, iter, &icon_count); |
| 251 if (!result) | 251 if (!result) |
| 252 return false; | 252 return false; |
| 253 for (size_t i = 0; i < icon_count; ++i) { | 253 for (size_t i = 0; i < icon_count; ++i) { |
| 254 param_type::IconInfo icon_info; | 254 param_type::IconInfo icon_info; |
| 255 result = | 255 result = |
| 256 ReadParam(m, iter, &icon_info.url) && | 256 ReadParam(m, iter, &icon_info.url) && |
| 257 ReadParam(m, iter, &icon_info.width) && | 257 ReadParam(m, iter, &icon_info.width) && |
| 258 ReadParam(m, iter, &icon_info.height); | 258 ReadParam(m, iter, &icon_info.height); |
| 259 if (!result) | 259 if (!result) |
| 260 return false; | 260 return false; |
| 261 r->icons.push_back(icon_info); | 261 r->icons.push_back(icon_info); |
| 262 } | 262 } |
| 263 return true; | 263 return true; |
| 264 } | 264 } |
| 265 | 265 |
| 266 void ParamTraits<webkit_glue::WebApplicationInfo>::Log( | 266 void ParamTraits<WebApplicationInfo>::Log(const WebApplicationInfo& p, |
| 267 const webkit_glue::WebApplicationInfo& p, std::string* l) { | 267 std::string* l) { |
| 268 l->append("<WebApplicationInfo>"); | 268 l->append("<WebApplicationInfo>"); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void ParamTraits<URLRequestStatus>::Write(Message* m, const param_type& p) { | 271 void ParamTraits<URLRequestStatus>::Write(Message* m, const param_type& p) { |
| 272 WriteParam(m, static_cast<int>(p.status())); | 272 WriteParam(m, static_cast<int>(p.status())); |
| 273 WriteParam(m, p.os_error()); | 273 WriteParam(m, p.os_error()); |
| 274 } | 274 } |
| 275 | 275 |
| 276 bool ParamTraits<URLRequestStatus>::Read(const Message* m, void** iter, | 276 bool ParamTraits<URLRequestStatus>::Read(const Message* m, void** iter, |
| 277 param_type* r) { | 277 param_type* r) { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 l->append(","); | 619 l->append(","); |
| 620 LogParam(p.last_modified.ToDoubleT(), l); | 620 LogParam(p.last_modified.ToDoubleT(), l); |
| 621 l->append(","); | 621 l->append(","); |
| 622 LogParam(p.last_accessed.ToDoubleT(), l); | 622 LogParam(p.last_accessed.ToDoubleT(), l); |
| 623 l->append(","); | 623 l->append(","); |
| 624 LogParam(p.creation_time.ToDoubleT(), l); | 624 LogParam(p.creation_time.ToDoubleT(), l); |
| 625 l->append(")"); | 625 l->append(")"); |
| 626 } | 626 } |
| 627 | 627 |
| 628 } // namespace IPC | 628 } // namespace IPC |
| OLD | NEW |