OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/devtools/devtools_window.h" | 5 #include "chrome/browser/devtools/devtools_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 | 1135 |
1136 void DevToolsWindow::RunFileChooser(content::RenderFrameHost* render_frame_host, | 1136 void DevToolsWindow::RunFileChooser(content::RenderFrameHost* render_frame_host, |
1137 const content::FileChooserParams& params) { | 1137 const content::FileChooserParams& params) { |
1138 FileSelectHelper::RunFileChooser(render_frame_host, params); | 1138 FileSelectHelper::RunFileChooser(render_frame_host, params); |
1139 } | 1139 } |
1140 | 1140 |
1141 bool DevToolsWindow::PreHandleGestureEvent( | 1141 bool DevToolsWindow::PreHandleGestureEvent( |
1142 WebContents* source, | 1142 WebContents* source, |
1143 const blink::WebGestureEvent& event) { | 1143 const blink::WebGestureEvent& event) { |
1144 // Disable pinch zooming. | 1144 // Disable pinch zooming. |
1145 return event.GetType() == blink::WebGestureEvent::kGesturePinchBegin || | 1145 return blink::WebInputEvent::IsPinchGestureEventType(event.GetType()); |
1146 event.GetType() == blink::WebGestureEvent::kGesturePinchUpdate || | |
1147 event.GetType() == blink::WebGestureEvent::kGesturePinchEnd; | |
1148 } | 1146 } |
1149 | 1147 |
1150 void DevToolsWindow::ShowCertificateViewerInDevTools( | 1148 void DevToolsWindow::ShowCertificateViewerInDevTools( |
1151 content::WebContents* web_contents, | 1149 content::WebContents* web_contents, |
1152 scoped_refptr<net::X509Certificate> certificate) { | 1150 scoped_refptr<net::X509Certificate> certificate) { |
1153 ShowCertificateViewer(certificate); | 1151 ShowCertificateViewer(certificate); |
1154 } | 1152 } |
1155 | 1153 |
1156 void DevToolsWindow::ActivateWindow() { | 1154 void DevToolsWindow::ActivateWindow() { |
1157 if (life_stage_ != kLoadCompleted) | 1155 if (life_stage_ != kLoadCompleted) |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1427 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
1430 // Only route reload via front-end if the agent is attached. | 1428 // Only route reload via front-end if the agent is attached. |
1431 WebContents* wc = GetInspectedWebContents(); | 1429 WebContents* wc = GetInspectedWebContents(); |
1432 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1430 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
1433 return false; | 1431 return false; |
1434 base::Value bypass_cache_value(bypass_cache); | 1432 base::Value bypass_cache_value(bypass_cache); |
1435 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1433 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
1436 &bypass_cache_value, nullptr, nullptr); | 1434 &bypass_cache_value, nullptr, nullptr); |
1437 return true; | 1435 return true; |
1438 } | 1436 } |
OLD | NEW |