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/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 const content::NativeWebKeyboardEvent& event) { | 922 const content::NativeWebKeyboardEvent& event) { |
923 if (event.windowsKeyCode == 0x08) { | 923 if (event.windowsKeyCode == 0x08) { |
924 // Do not navigate back in history on Windows (http://crbug.com/74156). | 924 // Do not navigate back in history on Windows (http://crbug.com/74156). |
925 return; | 925 return; |
926 } | 926 } |
927 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 927 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
928 if (inspected_window) | 928 if (inspected_window) |
929 inspected_window->HandleKeyboardEvent(event); | 929 inspected_window->HandleKeyboardEvent(event); |
930 } | 930 } |
931 | 931 |
932 content::JavaScriptDialogManager* DevToolsWindow::GetJavaScriptDialogManager() { | 932 content::JavaScriptDialogManager* DevToolsWindow::GetJavaScriptDialogManager( |
| 933 WebContents* source) { |
933 WebContents* inspected_web_contents = GetInspectedWebContents(); | 934 WebContents* inspected_web_contents = GetInspectedWebContents(); |
934 return (inspected_web_contents && inspected_web_contents->GetDelegate()) ? | 935 return (inspected_web_contents && inspected_web_contents->GetDelegate()) |
935 inspected_web_contents->GetDelegate()->GetJavaScriptDialogManager() : | 936 ? inspected_web_contents->GetDelegate() |
936 content::WebContentsDelegate::GetJavaScriptDialogManager(); | 937 ->GetJavaScriptDialogManager(inspected_web_contents) |
| 938 : content::WebContentsDelegate::GetJavaScriptDialogManager(source); |
937 } | 939 } |
938 | 940 |
939 content::ColorChooser* DevToolsWindow::OpenColorChooser( | 941 content::ColorChooser* DevToolsWindow::OpenColorChooser( |
940 WebContents* web_contents, | 942 WebContents* web_contents, |
941 SkColor initial_color, | 943 SkColor initial_color, |
942 const std::vector<content::ColorSuggestion>& suggestions) { | 944 const std::vector<content::ColorSuggestion>& suggestions) { |
943 return chrome::ShowColorChooser(web_contents, initial_color); | 945 return chrome::ShowColorChooser(web_contents, initial_color); |
944 } | 946 } |
945 | 947 |
946 void DevToolsWindow::RunFileChooser(WebContents* web_contents, | 948 void DevToolsWindow::RunFileChooser(WebContents* web_contents, |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 closure.Run(); | 1234 closure.Run(); |
1233 return; | 1235 return; |
1234 } | 1236 } |
1235 load_completed_callback_ = closure; | 1237 load_completed_callback_ = closure; |
1236 } | 1238 } |
1237 | 1239 |
1238 bool DevToolsWindow::ForwardKeyboardEvent( | 1240 bool DevToolsWindow::ForwardKeyboardEvent( |
1239 const content::NativeWebKeyboardEvent& event) { | 1241 const content::NativeWebKeyboardEvent& event) { |
1240 return event_forwarder_->ForwardEvent(event); | 1242 return event_forwarder_->ForwardEvent(event); |
1241 } | 1243 } |
OLD | NEW |