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( | |
pfeldman
2014/04/08 12:01:20
Lets introduce GetInstanceForInspectedWebContents
apavlov
2014/04/08 13:28:12
Done.
| |
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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2363 if (contents && !allow_js_access) { | 2371 if (contents && !allow_js_access) { |
2364 contents->web_contents()->GetController().LoadURL( | 2372 contents->web_contents()->GetController().LoadURL( |
2365 target_url, | 2373 target_url, |
2366 content::Referrer(), | 2374 content::Referrer(), |
2367 content::PAGE_TRANSITION_LINK, | 2375 content::PAGE_TRANSITION_LINK, |
2368 std::string()); // No extra headers. | 2376 std::string()); // No extra headers. |
2369 } | 2377 } |
2370 | 2378 |
2371 return contents != NULL; | 2379 return contents != NULL; |
2372 } | 2380 } |
OLD | NEW |