OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/common/common_param_traits.h" | 5 #include "content/public/common/common_param_traits.h" |
6 | 6 |
7 #include "content/public/common/content_constants.h" | 7 #include "content/public/common/content_constants.h" |
| 8 #include "content/public/common/draggable_region.h" |
8 #include "content/public/common/referrer.h" | 9 #include "content/public/common/referrer.h" |
9 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
10 #include "net/base/upload_data.h" | 11 #include "net/base/upload_data.h" |
11 #include "net/http/http_response_headers.h" | 12 #include "net/http/http_response_headers.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "ui/base/range/range.h" | 14 #include "ui/base/range/range.h" |
14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/rect_f.h" | 16 #include "ui/gfx/rect_f.h" |
16 | 17 |
17 namespace { | 18 namespace { |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 506 } |
506 const SkBitmap_Data* bmp_data = | 507 const SkBitmap_Data* bmp_data = |
507 reinterpret_cast<const SkBitmap_Data*>(fixed_data); | 508 reinterpret_cast<const SkBitmap_Data*>(fixed_data); |
508 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); | 509 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); |
509 } | 510 } |
510 | 511 |
511 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { | 512 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { |
512 l->append("<SkBitmap>"); | 513 l->append("<SkBitmap>"); |
513 } | 514 } |
514 | 515 |
| 516 void ParamTraits<content::DraggableRegion>::Write( |
| 517 Message* m, const param_type& p) { |
| 518 WriteParam(m, p.label); |
| 519 WriteParam(m, p.bounds); |
| 520 WriteParam(m, p.clip); |
| 521 } |
| 522 |
| 523 bool ParamTraits<content::DraggableRegion>::Read( |
| 524 const Message* m, PickleIterator* iter, param_type* r) { |
| 525 return ReadParam(m, iter, &r->label) && |
| 526 ReadParam(m, iter, &r->bounds) && |
| 527 ReadParam(m, iter, &r->clip); |
| 528 } |
| 529 |
| 530 void ParamTraits<content::DraggableRegion>::Log( |
| 531 const param_type& p, std::string* l) { |
| 532 l->append("("); |
| 533 LogParam(p.label, l); |
| 534 l->append(")"); |
| 535 } |
| 536 |
515 } // namespace IPC | 537 } // namespace IPC |
516 | 538 |
517 // Generate param traits write methods. | 539 // Generate param traits write methods. |
518 #include "ipc/param_traits_write_macros.h" | 540 #include "ipc/param_traits_write_macros.h" |
519 namespace IPC { | 541 namespace IPC { |
520 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ | 542 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ |
521 #include "content/public/common/common_param_traits_macros.h" | 543 #include "content/public/common/common_param_traits_macros.h" |
522 } // namespace IPC | 544 } // namespace IPC |
523 | 545 |
524 // Generate param traits read methods. | 546 // Generate param traits read methods. |
525 #include "ipc/param_traits_read_macros.h" | 547 #include "ipc/param_traits_read_macros.h" |
526 namespace IPC { | 548 namespace IPC { |
527 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ | 549 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ |
528 #include "content/public/common/common_param_traits_macros.h" | 550 #include "content/public/common/common_param_traits_macros.h" |
529 } // namespace IPC | 551 } // namespace IPC |
530 | 552 |
531 // Generate param traits log methods. | 553 // Generate param traits log methods. |
532 #include "ipc/param_traits_log_macros.h" | 554 #include "ipc/param_traits_log_macros.h" |
533 namespace IPC { | 555 namespace IPC { |
534 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ | 556 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ |
535 #include "content/public/common/common_param_traits_macros.h" | 557 #include "content/public/common/common_param_traits_macros.h" |
536 } // namespace IPC | 558 } // namespace IPC |
OLD | NEW |