| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 std::string screenshot_format = format.fromMaybe(kPng); | 291 std::string screenshot_format = format.fromMaybe(kPng); |
| 292 int screenshot_quality = quality.fromMaybe(kDefaultScreenshotQuality); | 292 int screenshot_quality = quality.fromMaybe(kDefaultScreenshotQuality); |
| 293 | 293 |
| 294 host_->GetRenderWidgetHost()->GetSnapshotFromBrowser( | 294 host_->GetRenderWidgetHost()->GetSnapshotFromBrowser( |
| 295 base::Bind(&PageHandler::ScreenshotCaptured, weak_factory_.GetWeakPtr(), | 295 base::Bind(&PageHandler::ScreenshotCaptured, weak_factory_.GetWeakPtr(), |
| 296 base::Passed(std::move(callback)), screenshot_format, | 296 base::Passed(std::move(callback)), screenshot_format, |
| 297 screenshot_quality), | 297 screenshot_quality), |
| 298 from_surface.fromMaybe(false)); | 298 from_surface.fromMaybe(false)); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void PageHandler::PrintToPDF(std::unique_ptr<PrintToPDFCallback> callback) { | 301 void PageHandler::PrintToPDF(Maybe<bool> landscape, |
| 302 Maybe<bool> display_header_footer, |
| 303 Maybe<bool> print_background, |
| 304 Maybe<double> scale, |
| 305 Maybe<double> paper_width, |
| 306 Maybe<double> paper_height, |
| 307 Maybe<double> margin_top, |
| 308 Maybe<double> margin_bottom, |
| 309 Maybe<double> margin_left, |
| 310 Maybe<double> margin_right, |
| 311 Maybe<String> page_ranges, |
| 312 std::unique_ptr<PrintToPDFCallback> callback) { |
| 302 callback->sendFailure(Response::Error("PrintToPDF is not implemented")); | 313 callback->sendFailure(Response::Error("PrintToPDF is not implemented")); |
| 303 return; | 314 return; |
| 304 } | 315 } |
| 305 | 316 |
| 306 Response PageHandler::StartScreencast(Maybe<std::string> format, | 317 Response PageHandler::StartScreencast(Maybe<std::string> format, |
| 307 Maybe<int> quality, | 318 Maybe<int> quality, |
| 308 Maybe<int> max_width, | 319 Maybe<int> max_width, |
| 309 Maybe<int> max_height, | 320 Maybe<int> max_height, |
| 310 Maybe<int> every_nth_frame) { | 321 Maybe<int> every_nth_frame) { |
| 311 RenderWidgetHostImpl* widget_host = | 322 RenderWidgetHostImpl* widget_host = |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 Response PageHandler::StopLoading() { | 585 Response PageHandler::StopLoading() { |
| 575 WebContentsImpl* web_contents = GetWebContents(); | 586 WebContentsImpl* web_contents = GetWebContents(); |
| 576 if (!web_contents) | 587 if (!web_contents) |
| 577 return Response::InternalError(); | 588 return Response::InternalError(); |
| 578 web_contents->Stop(); | 589 web_contents->Stop(); |
| 579 return Response::OK(); | 590 return Response::OK(); |
| 580 } | 591 } |
| 581 | 592 |
| 582 } // namespace protocol | 593 } // namespace protocol |
| 583 } // namespace content | 594 } // namespace content |
| OLD | NEW |