1. 13 Oct, 2017 1 commit
    • Elly Fong-Jones's avatar
      cocoa: allow application shortcuts to override builtin shortcuts · 1320aeb7
      Elly Fong-Jones authored
      This change refactors the Mac command dispatcher delegate to allow application
      shortcuts to override builtin shortcuts. This always worked for non-"window"
      shortcuts, but window shortcuts were dispatched in prePerformKeyEquivalent:,
      so they had higher priority than menu key equivalents. This change causes
      prePerformKeyEquivalent: to check for a menu key equivalent and execute that
      before consulting the window shortcut table. Since none of Chrome's default key
      equivalents overlap the window shortcuts, any menu item whose key equivalent
      matches a window shortcut is user-added and should have absolute priority.
      
      Bug: 410357
      Change-Id: I853168f1aee6c2fa82757f3fd41e04d7fc2a79be
      Reviewed-on: https://chromium-review.googlesource.com/716736
      Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
      Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
      Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#508801}
      1320aeb7
  2. 21 Nov, 2016 1 commit
    • mblsha's avatar
      MacViews: Views accelerators table should match the Cocoa one. · cb9c6b9d
      mblsha authored
      Updated views/accelerator_table.cc to match accelerators_cocoa.mm. Added
      eligible shortcuts from global_keyboard_shortcuts_mac.mm as well.
      
      Also handle the case when the user configured cmd-left to mean "previous tab",
      as it should take precedence over the built-in binding: we're consulting the
      [NSApp mainMenu] using CommandForKeyEvent().
      
      Lastly, the Cmd+{/} shortcuts are special as they would be impossible to
      perform on German and French keyboard layouts if we would simply check for
      keycodes as we do in accelerator_table.cc (crbug.com/25946).
      
      In order to tackle last two problems I've added PreHandleKeyboardEvent and
      HandleKeyboardEvent to the NativeBrowserFrame interface.
      
      BUG=620315
      
      Review-Url: https://codereview.chromium.org/2074643003
      Cr-Commit-Position: refs/heads/master@{#433574}
      cb9c6b9d
  3. 27 Sep, 2016 1 commit
    • ellyjones's avatar
      cocoa browser: bind cmd-opt-l, not cmd-l, for downloads · c2af9514
      ellyjones authored
      A longstanding trap in global_keyboard_shortcuts_mac: if a binding has a
      character specified instead of a keycode, the option modifier in the command is
      ignored, which makes sense, since option might be involved in typing the
      character in the first place. However, it does mean that bindings should never
      specify opt == true, which is exactly what I did in CL 2369453003. This CL adds
      a DCHECK to ensure nobody else trips over this.
      
      BUG=650528
      
      Review-Url: https://codereview.chromium.org/2373543003
      Cr-Commit-Position: refs/heads/master@{#421203}
      c2af9514
  4. 23 Sep, 2016 1 commit
  5. 20 May, 2016 1 commit
  6. 28 Apr, 2016 1 commit
  7. 26 Dec, 2015 1 commit
  8. 10 Nov, 2015 1 commit
  9. 09 Nov, 2015 2 commits
  10. 30 Jul, 2015 1 commit
    • jackhou's avatar
      [Mac] Remove BrowserCommandExecutor protocol. · 06c25a98
      jackhou authored
      Only BrowserWindowController implements this. Other implementors just
      turn it into a no-op. ChromeEventProcessingWindow (CEPW) now simply
      checks whether it's a Browser window and executes the command.
      
      This is the first step to factor out keyboard shortcut handling in CEPW into
      a component that can be reused in Views as it removes one (of two)
      dependencies on -[NSWindow windowController], which cannot be used
      to implement browser-side behavior under Views.
      
      Added new browser_test for shortcuts in global_keyboard_shortcuts_mac.
      
      Some history:
      BrowserCommandExecutor was added in r30619 (6 years ago) to allow a
      non-browser window to execute browser commands, but became obsolete
      a month later in r32445 when HtmlDialogWindowController (now
      WebDialogWindowController) decided to ignore those commands instead.
      
      BUG=508438
      
      Review URL: https://codereview.chromium.org/1250533003
      
      Cr-Commit-Position: refs/heads/master@{#341062}
      06c25a98
  11. 31 Mar, 2015 1 commit
  12. 16 Oct, 2014 1 commit
  13. 02 Dec, 2013 1 commit
  14. 28 Nov, 2011 1 commit
    • sail@chromium.org's avatar
      Cocoa: Fix avatar menu shortcut · 413d24d2
      sail@chromium.org authored
      If focus was in the Omnibox then pressing Command-M would incorrectly trigger the avatar menu.
      
      The problem was due to the fact that when MatchesEventForKeyboardShortcut() matches against a key character it ignores the shift flag.
      
      Fix was to use a key code for the shortcut so that the shift flag was correctly checked.
      
      BUG=104457
      TEST=Verified that Command-Shift-M correctly showed the avatar menu while focused on a web page and while focused on the location bar. Verified that Command-M correctly minimized the window while focused on a web page and focused on the location bar.
      
      Review URL: http://codereview.chromium.org/8718002
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111708 0039d316-1c4b-4281-b951-d872f2087c98
      413d24d2
  15. 25 Oct, 2011 1 commit
  16. 03 Oct, 2011 1 commit
  17. 31 Aug, 2011 1 commit
  18. 26 Aug, 2011 1 commit
  19. 19 Jul, 2011 1 commit
  20. 19 Nov, 2010 1 commit
  21. 17 Nov, 2010 1 commit
  22. 16 Nov, 2010 1 commit
  23. 08 Nov, 2010 1 commit
  24. 16 Jul, 2010 1 commit
  25. 05 Jan, 2010 1 commit
  26. 18 Dec, 2009 1 commit
  27. 21 Oct, 2009 3 commits
    • thakis@chromium.org's avatar
      Fix cmd-opt-left/right. · f7378a33
      thakis@chromium.org authored
      This surfaced because I moved global shortcut handling before menu dispatch recently, and global keyboard handling didn't look at the opt button, so it thought cmd-opt-left meant cmd-left and swallowed the event.
      
      BUG=25396
      TEST=Focus text box in web. cmd-opt-left/right should switch tabs, cmd-left/right should move cursor in text box. Focus web background. cmd-opt-left/right should switch tabs, cmd-left/right should do history navigation. Focus omnibox. cmd-opt-left/right should still switch tabs, cmd-left/right should move cursor. cmd-1/2 should switch tabs in all three places, cmd-opt-1/2 should not do anything.
      
      Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=29646
      Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=29648
      
      Review URL: http://codereview.chromium.org/313004
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29660 0039d316-1c4b-4281-b951-d872f2087c98
      f7378a33
    • nsylvain@chromium.org's avatar
      Revert 29646 - Fix cmdoptleft/right. · e7901f95
      nsylvain@chromium.org authored
      This surfaced because I moved global shortcut handling before menu dispatch recently, and global keyboard handling didn't look at the opt button, so it thought cmdoptleft meant cmdleft and swallowed the event.
      
      BUG=25396
      TEST=Focus text box in web. cmdoptleft/right should switch tabs, cmdleft/right should move cursor in text box. Focus web background. cmdoptleft/right should switch tabs, cmdleft/right should do history navigation. Focus omnibox. cmdoptleft/right should still switch tabs, cmdleft/right should move cursor. cmd1/2 should switch tabs in all three places, cmdopt1/2 should not do anything.
      
      Review URL: http://codereview.chromium.org/313004
      
      TBR=thakis@chromium.org
      Review URL: http://codereview.chromium.org/306025
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29648 0039d316-1c4b-4281-b951-d872f2087c98
      e7901f95
    • thakis@chromium.org's avatar
      Fix cmd-opt-left/right. · 06667936
      thakis@chromium.org authored
      This surfaced because I moved global shortcut handling before menu dispatch recently, and global keyboard handling didn't look at the opt button, so it thought cmd-opt-left meant cmd-left and swallowed the event.
      
      BUG=25396
      TEST=Focus text box in web. cmd-opt-left/right should switch tabs, cmd-left/right should move cursor in text box. Focus web background. cmd-opt-left/right should switch tabs, cmd-left/right should do history navigation. Focus omnibox. cmd-opt-left/right should still switch tabs, cmd-left/right should move cursor. cmd-1/2 should switch tabs in all three places, cmd-opt-1/2 should not do anything.
      
      Review URL: http://codereview.chromium.org/313004
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29646 0039d316-1c4b-4281-b951-d872f2087c98
      06667936
  28. 19 Oct, 2009 1 commit
    • thakis@chromium.org's avatar
      Make backspace not go back while IME is active. · 3ae1feb6
      thakis@chromium.org authored
      Linux does this in GtkIMContextWrapper::ProcessFilteredKeyPressEvent() by setting hardware_keycode to 0. It's a pain to change an NSEvent, so I just added a bool "skip" to NativeWebKeybordEvent and set it to "true" for rawkeydowns while ime is active.
      
      BUG=25000
      TEST=Open webpage. Focus text field. Type something, hit backspace. Text should be deleted. Focus background, hit backspace. Browser should go back one page. Focus text field, start IME (either by going to syspref->international->input menu and enabling e.g. "Kotoeri" and then selecting this in the top right corner and typing a single "a", or by just activating dead key ime on an us layout by hitting opt-u, opt-i, or opt-e), hit backspace. Browser should not go back but end IME mode.
      
      Review URL: http://codereview.chromium.org/295003
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29388 0039d316-1c4b-4281-b951-d872f2087c98
      3ae1feb6
  29. 16 Oct, 2009 1 commit
  30. 09 Oct, 2009 2 commits
  31. 18 Sep, 2009 1 commit
  32. 17 Sep, 2009 1 commit
  33. 07 Aug, 2009 1 commit
  34. 08 Jul, 2009 2 commits