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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 | 1102 |
1103 bool DevToolsWindow::PreHandleGestureEvent( | 1103 bool DevToolsWindow::PreHandleGestureEvent( |
1104 WebContents* source, | 1104 WebContents* source, |
1105 const blink::WebGestureEvent& event) { | 1105 const blink::WebGestureEvent& event) { |
1106 // Disable pinch zooming. | 1106 // Disable pinch zooming. |
1107 return event.type == blink::WebGestureEvent::GesturePinchBegin || | 1107 return event.type == blink::WebGestureEvent::GesturePinchBegin || |
1108 event.type == blink::WebGestureEvent::GesturePinchUpdate || | 1108 event.type == blink::WebGestureEvent::GesturePinchUpdate || |
1109 event.type == blink::WebGestureEvent::GesturePinchEnd; | 1109 event.type == blink::WebGestureEvent::GesturePinchEnd; |
1110 } | 1110 } |
1111 | 1111 |
| 1112 void DevToolsWindow::ShowCertificateViewerInDevTools( |
| 1113 content::WebContents* web_contents, |
| 1114 scoped_refptr<net::X509Certificate> certificate) { |
| 1115 ShowCertificateViewer(certificate); |
| 1116 } |
| 1117 |
1112 void DevToolsWindow::ActivateWindow() { | 1118 void DevToolsWindow::ActivateWindow() { |
1113 if (life_stage_ != kLoadCompleted) | 1119 if (life_stage_ != kLoadCompleted) |
1114 return; | 1120 return; |
1115 if (is_docked_ && GetInspectedBrowserWindow()) | 1121 if (is_docked_ && GetInspectedBrowserWindow()) |
1116 main_web_contents_->Focus(); | 1122 main_web_contents_->Focus(); |
1117 else if (!is_docked_ && !browser_->window()->IsActive()) | 1123 else if (!is_docked_ && !browser_->window()->IsActive()) |
1118 browser_->window()->Activate(); | 1124 browser_->window()->Activate(); |
1119 } | 1125 } |
1120 | 1126 |
1121 void DevToolsWindow::CloseWindow() { | 1127 void DevToolsWindow::CloseWindow() { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1377 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
1372 // Only route reload via front-end if the agent is attached. | 1378 // Only route reload via front-end if the agent is attached. |
1373 WebContents* wc = GetInspectedWebContents(); | 1379 WebContents* wc = GetInspectedWebContents(); |
1374 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1380 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
1375 return false; | 1381 return false; |
1376 base::FundamentalValue bypass_cache_value(bypass_cache); | 1382 base::FundamentalValue bypass_cache_value(bypass_cache); |
1377 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1383 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
1378 &bypass_cache_value, nullptr, nullptr); | 1384 &bypass_cache_value, nullptr, nullptr); |
1379 return true; | 1385 return true; |
1380 } | 1386 } |
OLD | NEW |