| 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 20 matching lines...) Expand all Loading... |
| 31 #include "content/public/browser/javascript_dialog_manager.h" | 31 #include "content/public/browser/javascript_dialog_manager.h" |
| 32 #include "content/public/browser/navigation_controller.h" | 32 #include "content/public/browser/navigation_controller.h" |
| 33 #include "content/public/browser/navigation_entry.h" | 33 #include "content/public/browser/navigation_entry.h" |
| 34 #include "content/public/browser/render_process_host.h" | 34 #include "content/public/browser/render_process_host.h" |
| 35 #include "content/public/browser/render_view_host.h" | 35 #include "content/public/browser/render_view_host.h" |
| 36 #include "content/public/browser/render_widget_host_view.h" | 36 #include "content/public/browser/render_widget_host_view.h" |
| 37 #include "content/public/browser/storage_partition.h" | 37 #include "content/public/browser/storage_partition.h" |
| 38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
| 39 #include "content/public/browser/web_contents_delegate.h" | 39 #include "content/public/browser/web_contents_delegate.h" |
| 40 #include "content/public/common/content_client.h" | 40 #include "content/public/common/content_client.h" |
| 41 #include "content/public/common/page_transition_types.h" | |
| 42 #include "content/public/common/referrer.h" | 41 #include "content/public/common/referrer.h" |
| 43 #include "content/public/common/url_constants.h" | 42 #include "content/public/common/url_constants.h" |
| 44 #include "ipc/ipc_sender.h" | 43 #include "ipc/ipc_sender.h" |
| 45 #include "net/base/net_util.h" | 44 #include "net/base/net_util.h" |
| 46 #include "storage/browser/quota/quota_manager.h" | 45 #include "storage/browser/quota/quota_manager.h" |
| 47 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 46 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 48 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 47 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
| 49 #include "third_party/WebKit/public/web/WebInputEvent.h" | 48 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 50 #include "third_party/skia/include/core/SkCanvas.h" | 49 #include "third_party/skia/include/core/SkCanvas.h" |
| 50 #include "ui/base/page_transition_types.h" |
| 51 #include "ui/gfx/codec/jpeg_codec.h" | 51 #include "ui/gfx/codec/jpeg_codec.h" |
| 52 #include "ui/gfx/codec/png_codec.h" | 52 #include "ui/gfx/codec/png_codec.h" |
| 53 #include "ui/gfx/display.h" | 53 #include "ui/gfx/display.h" |
| 54 #include "ui/gfx/screen.h" | 54 #include "ui/gfx/screen.h" |
| 55 #include "ui/gfx/size_conversions.h" | 55 #include "ui/gfx/size_conversions.h" |
| 56 #include "ui/snapshot/snapshot.h" | 56 #include "ui/snapshot/snapshot.h" |
| 57 #include "url/gurl.h" | 57 #include "url/gurl.h" |
| 58 | 58 |
| 59 using blink::WebGestureEvent; | 59 using blink::WebGestureEvent; |
| 60 using blink::WebInputEvent; | 60 using blink::WebInputEvent; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 GURL gurl(url); | 422 GURL gurl(url); |
| 423 if (!gurl.is_valid()) | 423 if (!gurl.is_valid()) |
| 424 return command->InternalErrorResponse("Cannot navigate to invalid URL"); | 424 return command->InternalErrorResponse("Cannot navigate to invalid URL"); |
| 425 | 425 |
| 426 if (!host_) | 426 if (!host_) |
| 427 return command->InternalErrorResponse("Could not connect to view"); | 427 return command->InternalErrorResponse("Could not connect to view"); |
| 428 | 428 |
| 429 WebContents* web_contents = WebContents::FromRenderViewHost(host_); | 429 WebContents* web_contents = WebContents::FromRenderViewHost(host_); |
| 430 if (web_contents) { | 430 if (web_contents) { |
| 431 web_contents->GetController() | 431 web_contents->GetController() |
| 432 .LoadURL(gurl, Referrer(), PAGE_TRANSITION_TYPED, std::string()); | 432 .LoadURL(gurl, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
| 433 // Fall through into the renderer. | 433 // Fall through into the renderer. |
| 434 return NULL; | 434 return NULL; |
| 435 } | 435 } |
| 436 | 436 |
| 437 return command->InternalErrorResponse("No WebContents to navigate"); | 437 return command->InternalErrorResponse("No WebContents to navigate"); |
| 438 } | 438 } |
| 439 | 439 |
| 440 scoped_refptr<DevToolsProtocol::Response> | 440 scoped_refptr<DevToolsProtocol::Response> |
| 441 RendererOverridesHandler::PageReload( | 441 RendererOverridesHandler::PageReload( |
| 442 scoped_refptr<DevToolsProtocol::Command> command) { | 442 scoped_refptr<DevToolsProtocol::Command> command) { |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 return; | 1325 return; |
| 1326 bool enabled = touch_emulation_enabled_ || screencast_command_.get(); | 1326 bool enabled = touch_emulation_enabled_ || screencast_command_.get(); |
| 1327 host_->SetTouchEventEmulationEnabled(enabled); | 1327 host_->SetTouchEventEmulationEnabled(enabled); |
| 1328 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 1328 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 1329 WebContents::FromRenderViewHost(host_)); | 1329 WebContents::FromRenderViewHost(host_)); |
| 1330 if (web_contents) | 1330 if (web_contents) |
| 1331 web_contents->SetForceDisableOverscrollContent(enabled); | 1331 web_contents->SetForceDisableOverscrollContent(enabled); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 } // namespace content | 1334 } // namespace content |
| OLD | NEW |