OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 // TODO(koz): Write a test for this http://crbug.com/100441. | 1142 // TODO(koz): Write a test for this http://crbug.com/100441. |
1143 if (event.windowsKeyCode == 27 && | 1143 if (event.windowsKeyCode == 27 && |
1144 fullscreen_controller_->HandleUserPressedEscape()) { | 1144 fullscreen_controller_->HandleUserPressedEscape()) { |
1145 return true; | 1145 return true; |
1146 } | 1146 } |
1147 return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut); | 1147 return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut); |
1148 } | 1148 } |
1149 | 1149 |
1150 void Browser::HandleKeyboardEvent(content::WebContents* source, | 1150 void Browser::HandleKeyboardEvent(content::WebContents* source, |
1151 const NativeWebKeyboardEvent& event) { | 1151 const NativeWebKeyboardEvent& event) { |
1152 window()->HandleKeyboardEvent(event); | 1152 DevToolsWindow* dev_tools_window = |
| 1153 DevToolsWindow::GetInstanceForInspectedRenderViewHost( |
| 1154 source->GetRenderViewHost()); |
| 1155 bool handled = false; |
| 1156 if (dev_tools_window) |
| 1157 handled = dev_tools_window->ForwardKeyboardEvent(event); |
| 1158 |
| 1159 if (!handled) |
| 1160 window()->HandleKeyboardEvent(event); |
1153 } | 1161 } |
1154 | 1162 |
1155 bool Browser::TabsNeedBeforeUnloadFired() { | 1163 bool Browser::TabsNeedBeforeUnloadFired() { |
1156 if (IsFastTabUnloadEnabled()) | 1164 if (IsFastTabUnloadEnabled()) |
1157 return fast_unload_controller_->TabsNeedBeforeUnloadFired(); | 1165 return fast_unload_controller_->TabsNeedBeforeUnloadFired(); |
1158 return unload_controller_->TabsNeedBeforeUnloadFired(); | 1166 return unload_controller_->TabsNeedBeforeUnloadFired(); |
1159 } | 1167 } |
1160 | 1168 |
1161 void Browser::OverscrollUpdate(int delta_y) { | 1169 void Browser::OverscrollUpdate(int delta_y) { |
1162 window_->OverscrollUpdate(delta_y); | 1170 window_->OverscrollUpdate(delta_y); |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2360 if (contents && !allow_js_access) { | 2368 if (contents && !allow_js_access) { |
2361 contents->web_contents()->GetController().LoadURL( | 2369 contents->web_contents()->GetController().LoadURL( |
2362 target_url, | 2370 target_url, |
2363 content::Referrer(), | 2371 content::Referrer(), |
2364 content::PAGE_TRANSITION_LINK, | 2372 content::PAGE_TRANSITION_LINK, |
2365 std::string()); // No extra headers. | 2373 std::string()); // No extra headers. |
2366 } | 2374 } |
2367 | 2375 |
2368 return contents != NULL; | 2376 return contents != NULL; |
2369 } | 2377 } |
OLD | NEW |