| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 --frames_in_flight_; | 477 --frames_in_flight_; |
| 478 return; | 478 return; |
| 479 } | 479 } |
| 480 | 480 |
| 481 gfx::SizeF screen_size_dip = | 481 gfx::SizeF screen_size_dip = |
| 482 gfx::ScaleSize(gfx::SizeF(view->GetPhysicalBackingSize()), | 482 gfx::ScaleSize(gfx::SizeF(view->GetPhysicalBackingSize()), |
| 483 1 / metadata.device_scale_factor); | 483 1 / metadata.device_scale_factor); |
| 484 scoped_refptr<ScreencastFrameMetadata> param_metadata = | 484 scoped_refptr<ScreencastFrameMetadata> param_metadata = |
| 485 ScreencastFrameMetadata::Create() | 485 ScreencastFrameMetadata::Create() |
| 486 ->set_page_scale_factor(metadata.page_scale_factor) | 486 ->set_page_scale_factor(metadata.page_scale_factor) |
| 487 ->set_offset_top(metadata.location_bar_content_translation.y()) | 487 ->set_offset_top(metadata.top_controls_height.y() * |
| 488 metadata.top_controls_shown_ratio) |
| 488 ->set_device_width(screen_size_dip.width()) | 489 ->set_device_width(screen_size_dip.width()) |
| 489 ->set_device_height(screen_size_dip.height()) | 490 ->set_device_height(screen_size_dip.height()) |
| 490 ->set_scroll_offset_x(metadata.root_scroll_offset.x()) | 491 ->set_scroll_offset_x(metadata.root_scroll_offset.x()) |
| 491 ->set_scroll_offset_y(metadata.root_scroll_offset.y()) | 492 ->set_scroll_offset_y(metadata.root_scroll_offset.y()) |
| 492 ->set_timestamp(timestamp.ToDoubleT()); | 493 ->set_timestamp(timestamp.ToDoubleT()); |
| 493 client_->ScreencastFrame(ScreencastFrameParams::Create() | 494 client_->ScreencastFrame(ScreencastFrameParams::Create() |
| 494 ->set_data(data) | 495 ->set_data(data) |
| 495 ->set_metadata(param_metadata) | 496 ->set_metadata(param_metadata) |
| 496 ->set_session_id(session_id_)); | 497 ->set_session_id(session_id_)); |
| 497 } | 498 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 516 | 517 |
| 517 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 518 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
| 518 scoped_refptr<dom::RGBA> color = | 519 scoped_refptr<dom::RGBA> color = |
| 519 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 520 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
| 520 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 521 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
| 521 } | 522 } |
| 522 | 523 |
| 523 } // namespace page | 524 } // namespace page |
| 524 } // namespace devtools | 525 } // namespace devtools |
| 525 } // namespace content | 526 } // namespace content |
| OLD | NEW |