Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: content/browser/devtools/protocol/page_handler.cc

Issue 2708563002: DevTools: allow embedder handling async remote debugger commands. (Closed)
Patch Set: extract variable Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | content/browser/devtools/protocol_config.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698