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