Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 225973003: DevTools: Forward whitelisted unhandled shortcuts from inspected page into DevTools frontend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address pfeldman's comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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* devtools_window =
1153 DevToolsWindow::GetInstanceForInspectedWebContents(source);
1154 bool handled = false;
1155 if (devtools_window)
1156 handled = devtools_window->ForwardKeyboardEvent(event);
1157
1158 if (!handled)
1159 window()->HandleKeyboardEvent(event);
1153 } 1160 }
1154 1161
1155 bool Browser::TabsNeedBeforeUnloadFired() { 1162 bool Browser::TabsNeedBeforeUnloadFired() {
1156 if (IsFastTabUnloadEnabled()) 1163 if (IsFastTabUnloadEnabled())
1157 return fast_unload_controller_->TabsNeedBeforeUnloadFired(); 1164 return fast_unload_controller_->TabsNeedBeforeUnloadFired();
1158 return unload_controller_->TabsNeedBeforeUnloadFired(); 1165 return unload_controller_->TabsNeedBeforeUnloadFired();
1159 } 1166 }
1160 1167
1161 void Browser::OverscrollUpdate(int delta_y) { 1168 void Browser::OverscrollUpdate(int delta_y) {
1162 window_->OverscrollUpdate(delta_y); 1169 window_->OverscrollUpdate(delta_y);
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 if (contents && !allow_js_access) { 2370 if (contents && !allow_js_access) {
2364 contents->web_contents()->GetController().LoadURL( 2371 contents->web_contents()->GetController().LoadURL(
2365 target_url, 2372 target_url,
2366 content::Referrer(), 2373 content::Referrer(),
2367 content::PAGE_TRANSITION_LINK, 2374 content::PAGE_TRANSITION_LINK,
2368 std::string()); // No extra headers. 2375 std::string()); // No extra headers.
2369 } 2376 }
2370 2377
2371 return contents != NULL; 2378 return contents != NULL;
2372 } 2379 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698