| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/emulation_handler.h" | 5 #include "content/browser/devtools/protocol/emulation_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // Set size of frame by resizing RWHV if available. | 249 // Set size of frame by resizing RWHV if available. |
| 250 RenderWidgetHostImpl* widget_host = | 250 RenderWidgetHostImpl* widget_host = |
| 251 host_ ? host_->GetRenderWidgetHost() : nullptr; | 251 host_ ? host_->GetRenderWidgetHost() : nullptr; |
| 252 if (!widget_host) | 252 if (!widget_host) |
| 253 return Response::ServerError("Target does not support setVisibleSize"); | 253 return Response::ServerError("Target does not support setVisibleSize"); |
| 254 | 254 |
| 255 widget_host->GetView()->SetSize(gfx::Size(width, height)); | 255 widget_host->GetView()->SetSize(gfx::Size(width, height)); |
| 256 return Response::OK(); | 256 return Response::OK(); |
| 257 } | 257 } |
| 258 | 258 |
| 259 Response EmulationHandler::ForceViewport(double x, double y, double scale) { |
| 260 return Response::FallThrough(); |
| 261 } |
| 262 |
| 263 Response EmulationHandler::ResetViewport() { |
| 264 return Response::FallThrough(); |
| 265 } |
| 266 |
| 267 Response EmulationHandler::ResetPageScaleFactor() { |
| 268 return Response::FallThrough(); |
| 269 } |
| 270 |
| 271 Response EmulationHandler::SetPageScaleFactor(double page_scale_factor) { |
| 272 return Response::FallThrough(); |
| 273 } |
| 274 |
| 275 Response EmulationHandler::SetScriptExecutionDisabled(bool disabled) { |
| 276 return Response::FallThrough(); |
| 277 } |
| 278 |
| 279 Response EmulationHandler::SetEmulatedMedia(const std::string& media) { |
| 280 return Response::FallThrough(); |
| 281 } |
| 282 |
| 283 Response EmulationHandler::SetCPUThrottlingRate(double rate) { |
| 284 return Response::FallThrough(); |
| 285 } |
| 286 |
| 287 Response EmulationHandler::SetVirtualTimePolicy( |
| 288 const std::string& policy, |
| 289 const int* budget) { |
| 290 return Response::FallThrough(); |
| 291 } |
| 292 |
| 259 WebContentsImpl* EmulationHandler::GetWebContents() { | 293 WebContentsImpl* EmulationHandler::GetWebContents() { |
| 260 return host_ ? | 294 return host_ ? |
| 261 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : | 295 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : |
| 262 nullptr; | 296 nullptr; |
| 263 } | 297 } |
| 264 | 298 |
| 265 void EmulationHandler::UpdateTouchEventEmulationState() { | 299 void EmulationHandler::UpdateTouchEventEmulationState() { |
| 266 RenderWidgetHostImpl* widget_host = | 300 RenderWidgetHostImpl* widget_host = |
| 267 host_ ? host_->GetRenderWidgetHost() : nullptr; | 301 host_ ? host_->GetRenderWidgetHost() : nullptr; |
| 268 if (!widget_host) | 302 if (!widget_host) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 285 widget_host->GetRoutingID(), device_emulation_params_)); | 319 widget_host->GetRoutingID(), device_emulation_params_)); |
| 286 } else { | 320 } else { |
| 287 widget_host->Send(new ViewMsg_DisableDeviceEmulation( | 321 widget_host->Send(new ViewMsg_DisableDeviceEmulation( |
| 288 widget_host->GetRoutingID())); | 322 widget_host->GetRoutingID())); |
| 289 } | 323 } |
| 290 } | 324 } |
| 291 | 325 |
| 292 } // namespace emulation | 326 } // namespace emulation |
| 293 } // namespace devtools | 327 } // namespace devtools |
| 294 } // namespace content | 328 } // namespace content |
| OLD | NEW |