| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 std::string screenshot_format = format.fromMaybe(kPng); | 290 std::string screenshot_format = format.fromMaybe(kPng); |
| 291 int screenshot_quality = quality.fromMaybe(kDefaultScreenshotQuality); | 291 int screenshot_quality = quality.fromMaybe(kDefaultScreenshotQuality); |
| 292 | 292 |
| 293 host_->GetRenderWidgetHost()->GetSnapshotFromBrowser( | 293 host_->GetRenderWidgetHost()->GetSnapshotFromBrowser( |
| 294 base::Bind(&PageHandler::ScreenshotCaptured, weak_factory_.GetWeakPtr(), | 294 base::Bind(&PageHandler::ScreenshotCaptured, weak_factory_.GetWeakPtr(), |
| 295 base::Passed(std::move(callback)), screenshot_format, | 295 base::Passed(std::move(callback)), screenshot_format, |
| 296 screenshot_quality)); | 296 screenshot_quality)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void PageHandler::PrintToPDF(std::unique_ptr<PrintToPDFCallback> callback) { |
| 300 callback->sendFailure(Response::Error("PrintToPDF is not implemented")); |
| 301 return; |
| 302 } |
| 303 |
| 299 Response PageHandler::StartScreencast(Maybe<std::string> format, | 304 Response PageHandler::StartScreencast(Maybe<std::string> format, |
| 300 Maybe<int> quality, | 305 Maybe<int> quality, |
| 301 Maybe<int> max_width, | 306 Maybe<int> max_width, |
| 302 Maybe<int> max_height, | 307 Maybe<int> max_height, |
| 303 Maybe<int> every_nth_frame) { | 308 Maybe<int> every_nth_frame) { |
| 304 RenderWidgetHostImpl* widget_host = | 309 RenderWidgetHostImpl* widget_host = |
| 305 host_ ? host_->GetRenderWidgetHost() : nullptr; | 310 host_ ? host_->GetRenderWidgetHost() : nullptr; |
| 306 if (!widget_host) | 311 if (!widget_host) |
| 307 return Response::InternalError(); | 312 return Response::InternalError(); |
| 308 | 313 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 Response PageHandler::StopLoading() { | 585 Response PageHandler::StopLoading() { |
| 581 WebContentsImpl* web_contents = GetWebContents(); | 586 WebContentsImpl* web_contents = GetWebContents(); |
| 582 if (!web_contents) | 587 if (!web_contents) |
| 583 return Response::InternalError(); | 588 return Response::InternalError(); |
| 584 web_contents->Stop(); | 589 web_contents->Stop(); |
| 585 return Response::OK(); | 590 return Response::OK(); |
| 586 } | 591 } |
| 587 | 592 |
| 588 } // namespace protocol | 593 } // namespace protocol |
| 589 } // namespace content | 594 } // namespace content |
| OLD | NEW |