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

Side by Side Diff: content/browser/devtools/renderer_overrides_handler.cc

Issue 579223002: [DevTools] Pass screencast commands to the renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/renderer_overrides_handler.h" 5 #include "content/browser/devtools/renderer_overrides_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/barrier_closure.h" 10 #include "base/barrier_closure.h"
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (!host_) 608 if (!host_)
609 return command->InternalErrorResponse("Could not connect to view"); 609 return command->InternalErrorResponse("Could not connect to view");
610 bool visible = !host_->is_hidden(); 610 bool visible = !host_->is_hidden();
611 NotifyScreencastVisibility(visible); 611 NotifyScreencastVisibility(visible);
612 if (visible) { 612 if (visible) {
613 if (has_last_compositor_frame_metadata_) 613 if (has_last_compositor_frame_metadata_)
614 InnerSwapCompositorFrame(); 614 InnerSwapCompositorFrame();
615 else 615 else
616 host_->Send(new ViewMsg_ForceRedraw(host_->GetRoutingID(), 0)); 616 host_->Send(new ViewMsg_ForceRedraw(host_->GetRoutingID(), 0));
617 } 617 }
618 return command->SuccessResponse(NULL); 618 // Pass through to the renderer.
619 return NULL;
619 } 620 }
620 621
621 scoped_refptr<DevToolsProtocol::Response> 622 scoped_refptr<DevToolsProtocol::Response>
622 RendererOverridesHandler::PageStopScreencast( 623 RendererOverridesHandler::PageStopScreencast(
623 scoped_refptr<DevToolsProtocol::Command> command) { 624 scoped_refptr<DevToolsProtocol::Command> command) {
624 last_frame_time_ = base::TimeTicks(); 625 last_frame_time_ = base::TimeTicks();
625 screencast_command_ = NULL; 626 screencast_command_ = NULL;
626 UpdateTouchEventEmulationState(); 627 UpdateTouchEventEmulationState();
627 return command->SuccessResponse(NULL); 628 // Pass through to the renderer.
629 return NULL;
628 } 630 }
629 631
630 void RendererOverridesHandler::ScreencastFrameCaptured( 632 void RendererOverridesHandler::ScreencastFrameCaptured(
631 const std::string& format, 633 const std::string& format,
632 int quality, 634 int quality,
633 const cc::CompositorFrameMetadata& metadata, 635 const cc::CompositorFrameMetadata& metadata,
634 bool success, 636 bool success,
635 const SkBitmap& bitmap) { 637 const SkBitmap& bitmap) {
636 if (!success) { 638 if (!success) {
637 if (capture_retry_count_) { 639 if (capture_retry_count_) {
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 return; 1327 return;
1326 bool enabled = touch_emulation_enabled_ || screencast_command_.get(); 1328 bool enabled = touch_emulation_enabled_ || screencast_command_.get();
1327 host_->SetTouchEventEmulationEnabled(enabled); 1329 host_->SetTouchEventEmulationEnabled(enabled);
1328 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 1330 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
1329 WebContents::FromRenderViewHost(host_)); 1331 WebContents::FromRenderViewHost(host_));
1330 if (web_contents) 1332 if (web_contents)
1331 web_contents->SetForceDisableOverscrollContent(enabled); 1333 web_contents->SetForceDisableOverscrollContent(enabled);
1332 } 1334 }
1333 1335
1334 } // namespace content 1336 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698