-
thakis@chromium.org authored
Since cmd-left/right should not do history if the omnibox is focussed, but cmd-1-9 should work if the omnibox is focussed, we have to differentiate between window- and browser-level shortcuts. (Because performKeyEquivalent bubbles up from the window -- and if we let it bubble up to the omnibox, then the omnibox handles cmd-left/right just fine, but it swallows cmd-1 and doesn't give us a chance to intercept this. That means cmd-left doesn't work if you hit cmd-l tab, which focusses something that's neither omnibox nor tab contents. This behavior is consistent with safari and camino, and I think it's the best we can do without rewriting event dispatching. Camino does this here: http://mxr.mozilla.org/seamonkey/source/camino/src/browser/BrowserWindow.mm#128 http://mxr.mozilla.org/seamonkey/source/camino/src/browser/BrowserWrapper.mm#1031 ) BUG=12557 TEST=Focus text box on a web page. cmd-left/right should go to start/end of text. Focus webpage background. cmd-left/right \ should go history back/forward. When the omnibox is focussed, cmd-left/right should move the caret, but cmd-1-9 should still switch tabs. Note that shortcuts still don't work if a subwindow (e.g. find bar, bookmark bubble) has focus. Review URL: http://codereview.chromium.org/251069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28505 0039d316-1c4b-4281-b951-d872f2087c98
1d313b83