OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/devtools/protocol/page_handler.h" | 5 #include "content/browser/devtools/protocol/page_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 --frames_in_flight_; | 540 --frames_in_flight_; |
541 return; | 541 return; |
542 } | 542 } |
543 | 543 |
544 gfx::SizeF screen_size_dip = | 544 gfx::SizeF screen_size_dip = |
545 gfx::ScaleSize(gfx::SizeF(view->GetPhysicalBackingSize()), | 545 gfx::ScaleSize(gfx::SizeF(view->GetPhysicalBackingSize()), |
546 1 / metadata.device_scale_factor); | 546 1 / metadata.device_scale_factor); |
547 scoped_refptr<ScreencastFrameMetadata> param_metadata = | 547 scoped_refptr<ScreencastFrameMetadata> param_metadata = |
548 ScreencastFrameMetadata::Create() | 548 ScreencastFrameMetadata::Create() |
549 ->set_page_scale_factor(metadata.page_scale_factor) | 549 ->set_page_scale_factor(metadata.page_scale_factor) |
550 ->set_offset_top(metadata.location_bar_content_translation.y()) | 550 ->set_offset_top(metadata.top_controls_height * |
| 551 metadata.top_controls_shown_ratio) |
551 ->set_device_width(screen_size_dip.width()) | 552 ->set_device_width(screen_size_dip.width()) |
552 ->set_device_height(screen_size_dip.height()) | 553 ->set_device_height(screen_size_dip.height()) |
553 ->set_scroll_offset_x(metadata.root_scroll_offset.x()) | 554 ->set_scroll_offset_x(metadata.root_scroll_offset.x()) |
554 ->set_scroll_offset_y(metadata.root_scroll_offset.y()) | 555 ->set_scroll_offset_y(metadata.root_scroll_offset.y()) |
555 ->set_timestamp(timestamp.ToDoubleT()); | 556 ->set_timestamp(timestamp.ToDoubleT()); |
556 client_->ScreencastFrame(ScreencastFrameParams::Create() | 557 client_->ScreencastFrame(ScreencastFrameParams::Create() |
557 ->set_data(data) | 558 ->set_data(data) |
558 ->set_metadata(param_metadata) | 559 ->set_metadata(param_metadata) |
559 ->set_session_id(session_id_)); | 560 ->set_session_id(session_id_)); |
560 } | 561 } |
(...skipping 18 matching lines...) Expand all Loading... |
579 | 580 |
580 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 581 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
581 scoped_refptr<dom::RGBA> color = | 582 scoped_refptr<dom::RGBA> color = |
582 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 583 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
583 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 584 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
584 } | 585 } |
585 | 586 |
586 } // namespace page | 587 } // namespace page |
587 } // namespace devtools | 588 } // namespace devtools |
588 } // namespace content | 589 } // namespace content |
OLD | NEW |