| OLD | NEW |
| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 screencast_command_ = NULL; | 625 screencast_command_ = NULL; |
| 626 UpdateTouchEventEmulationState(); | 626 UpdateTouchEventEmulationState(); |
| 627 return command->SuccessResponse(NULL); | 627 return command->SuccessResponse(NULL); |
| 628 } | 628 } |
| 629 | 629 |
| 630 void RendererOverridesHandler::ScreencastFrameCaptured( | 630 void RendererOverridesHandler::ScreencastFrameCaptured( |
| 631 const std::string& format, | 631 const std::string& format, |
| 632 int quality, | 632 int quality, |
| 633 const cc::CompositorFrameMetadata& metadata, | 633 const cc::CompositorFrameMetadata& metadata, |
| 634 bool success, | 634 bool success, |
| 635 const SkBitmap& bitmap) { | 635 const SkBitmap& bitmap, |
| 636 const int& readback_response) { |
| 636 if (!success) { | 637 if (!success) { |
| 637 if (capture_retry_count_) { | 638 if (capture_retry_count_) { |
| 638 --capture_retry_count_; | 639 --capture_retry_count_; |
| 639 base::MessageLoop::current()->PostDelayedTask( | 640 base::MessageLoop::current()->PostDelayedTask( |
| 640 FROM_HERE, | 641 FROM_HERE, |
| 641 base::Bind(&RendererOverridesHandler::InnerSwapCompositorFrame, | 642 base::Bind(&RendererOverridesHandler::InnerSwapCompositorFrame, |
| 642 weak_factory_.GetWeakPtr()), | 643 weak_factory_.GetWeakPtr()), |
| 643 base::TimeDelta::FromMilliseconds(kFrameRateThresholdMs)); | 644 base::TimeDelta::FromMilliseconds(kFrameRateThresholdMs)); |
| 644 } | 645 } |
| 645 return; | 646 return; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 weak_factory_.GetWeakPtr()), | 1008 weak_factory_.GetWeakPtr()), |
| 1008 kN32_SkColorType); | 1009 kN32_SkColorType); |
| 1009 } | 1010 } |
| 1010 | 1011 |
| 1011 void RendererOverridesHandler::ResetColorPickerFrame() { | 1012 void RendererOverridesHandler::ResetColorPickerFrame() { |
| 1012 color_picker_frame_.reset(); | 1013 color_picker_frame_.reset(); |
| 1013 last_cursor_x_ = -1; | 1014 last_cursor_x_ = -1; |
| 1014 last_cursor_y_ = -1; | 1015 last_cursor_y_ = -1; |
| 1015 } | 1016 } |
| 1016 | 1017 |
| 1017 void RendererOverridesHandler::ColorPickerFrameUpdated( | 1018 void RendererOverridesHandler::ColorPickerFrameUpdated(bool succeeded, |
| 1018 bool succeeded, | 1019 const SkBitmap& bitmap, |
| 1019 const SkBitmap& bitmap) { | 1020 const int& response) { |
| 1020 if (!color_picker_enabled_) | 1021 if (!color_picker_enabled_) |
| 1021 return; | 1022 return; |
| 1022 | 1023 |
| 1023 if (succeeded) { | 1024 if (succeeded) { |
| 1024 color_picker_frame_ = bitmap; | 1025 color_picker_frame_ = bitmap; |
| 1025 UpdateColorPickerCursor(); | 1026 UpdateColorPickerCursor(); |
| 1026 } | 1027 } |
| 1027 } | 1028 } |
| 1028 | 1029 |
| 1029 bool RendererOverridesHandler::HandleMouseEvent( | 1030 bool RendererOverridesHandler::HandleMouseEvent( |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 return; | 1326 return; |
| 1326 bool enabled = touch_emulation_enabled_ || screencast_command_.get(); | 1327 bool enabled = touch_emulation_enabled_ || screencast_command_.get(); |
| 1327 host_->SetTouchEventEmulationEnabled(enabled); | 1328 host_->SetTouchEventEmulationEnabled(enabled); |
| 1328 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 1329 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 1329 WebContents::FromRenderViewHost(host_)); | 1330 WebContents::FromRenderViewHost(host_)); |
| 1330 if (web_contents) | 1331 if (web_contents) |
| 1331 web_contents->SetForceDisableOverscrollContent(enabled); | 1332 web_contents->SetForceDisableOverscrollContent(enabled); |
| 1332 } | 1333 } |
| 1333 | 1334 |
| 1334 } // namespace content | 1335 } // namespace content |
| OLD | NEW |