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

Issue 370293004: mac: Load the system hotkeys after launch. (Closed)

Created:
6 years, 5 months ago by erikchen
Modified:
6 years, 5 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, James Su, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

mac: Load the system hotkeys after launch. Shortly after launch, the system hotkeys are loaded and parsed. If a hotkey is reserved by the system, it is not passed to the renderer. This allows system hotkeys like (cmd + `) to work even if a flash plugin is selected. Add a histogram to ensure that the system hotkey plist is being correctly loaded and parsed. BUG=383558 TEST=Open 2 Chrome windows. Navigate one to www.twitch.tv. The site should include a flash plugin that automatically starts playing a video. Select the flash plugin. The hotkey combination (cmd + `) should switch between the open windows. The hotkey combination (cmd + L) should have no effect (it is a Chrome hotkey, not a browser hotkey). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283405

Patch Set 1 : First #

Patch Set 2 : Histograms and dchecks. #

Total comments: 14

Patch Set 3 : Address comments from avi by moving classes to content/ #

Patch Set 4 : Address comments from rsesek by removing gcd. #

Total comments: 25

Patch Set 5 : Address comments from rsesek, round 2. #

Total comments: 9

Patch Set 6 : Address comments from rsesek, round 3. #

Total comments: 6

Patch Set 7 : Respond to isherman comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -1121 lines) Patch
M chrome/browser/ui/cocoa/system_hotkey_map.h View 1 2 1 chunk +0 lines, -44 lines 0 comments Download
M chrome/browser/ui/cocoa/system_hotkey_map.mm View 1 2 1 chunk +0 lines, -131 lines 0 comments Download
M chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm View 1 2 1 chunk +0 lines, -51 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 1 chunk +0 lines, -1 line 0 comments Download
D chrome/test/data/mac/mac_system_hotkeys.plist View 1 2 1 chunk +0 lines, -866 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
A content/browser/cocoa/system_hotkey_helper_mac.h View 1 2 3 4 5 1 chunk +56 lines, -0 lines 0 comments Download
A content/browser/cocoa/system_hotkey_helper_mac.mm View 1 2 3 4 5 6 1 chunk +77 lines, -0 lines 0 comments Download
A + content/browser/cocoa/system_hotkey_map.h View 1 2 3 4 2 chunks +27 lines, -9 lines 0 comments Download
A + content/browser/cocoa/system_hotkey_map.mm View 1 2 3 4 6 chunks +25 lines, -9 lines 0 comments Download
A + content/browser/cocoa/system_hotkey_map_unittest.mm View 1 2 3 4 3 chunks +26 lines, -9 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 4 chunks +30 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A + content/test/data/mac/mac_system_hotkeys.plist View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
erikchen
avi: Please review.
6 years, 5 months ago (2014-07-07 21:48:03 UTC) #1
Avi (use Gerrit)
https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/browser.cc#newcode455 chrome/browser/ui/browser.cc:455: #endif // defined(OS_MACOSX) && !defined(OS_IOS) But this isn't a ...
6 years, 5 months ago (2014-07-07 21:57:49 UTC) #2
Robert Sesek
drive-by https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm File chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm (right): https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm#newcode28 chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm:28: void SystemHotkeyHelperMac::DeferredLoadSystemHotkeys() { On 2014/07/07 21:57:49, Avi (OOO ...
6 years, 5 months ago (2014-07-07 22:21:36 UTC) #3
erikchen
avi, rsesek: PTAL https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/browser.cc#newcode455 chrome/browser/ui/browser.cc:455: #endif // defined(OS_MACOSX) && !defined(OS_IOS) On ...
6 years, 5 months ago (2014-07-08 01:51:39 UTC) #4
Avi (use Gerrit)
https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/browser.cc#newcode455 chrome/browser/ui/browser.cc:455: #endif // defined(OS_MACOSX) && !defined(OS_IOS) I don't have time ...
6 years, 5 months ago (2014-07-08 02:04:20 UTC) #5
Robert Sesek
https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm File chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm (right): https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm#newcode47 chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm:47: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), On 2014/07/08 01:51:39, erikchen1 wrote: > On ...
6 years, 5 months ago (2014-07-08 13:40:01 UTC) #6
erikchen
rsesek: PTAL https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm File chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm (right): https://codereview.chromium.org/370293004/diff/100001/chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm#newcode47 chrome/browser/ui/cocoa/system_hotkey_helper_mac.mm:47: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), On 2014/07/08 13:40:00, rsesek (OOO ...
6 years, 5 months ago (2014-07-10 02:07:32 UTC) #7
Avi (use Gerrit)
I'm pretty happy with this. If you can make that scoped_nsobject change work, that would ...
6 years, 5 months ago (2014-07-10 02:19:11 UTC) #8
Robert Sesek
https://codereview.chromium.org/370293004/diff/220001/content/browser/cocoa/system_hotkey_helper_mac.h File content/browser/cocoa/system_hotkey_helper_mac.h (right): https://codereview.chromium.org/370293004/diff/220001/content/browser/cocoa/system_hotkey_helper_mac.h#newcode21 content/browser/cocoa/system_hotkey_helper_mac.h:21: class SystemHotkeyHelperMac { Every class needs a class-level comment. ...
6 years, 5 months ago (2014-07-14 15:33:32 UTC) #9
erikchen
rsesek: PTAL https://codereview.chromium.org/370293004/diff/220001/content/browser/cocoa/system_hotkey_helper_mac.h File content/browser/cocoa/system_hotkey_helper_mac.h (right): https://codereview.chromium.org/370293004/diff/220001/content/browser/cocoa/system_hotkey_helper_mac.h#newcode21 content/browser/cocoa/system_hotkey_helper_mac.h:21: class SystemHotkeyHelperMac { On 2014/07/14 15:33:31, rsesek ...
6 years, 5 months ago (2014-07-14 18:17:38 UTC) #10
Robert Sesek
LGTM https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm File content/browser/cocoa/system_hotkey_map.mm (right): https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm#newcode121 content/browser/cocoa/system_hotkey_map.mm:121: std::vector<SystemHotkey>::const_iterator it; It occurs to me that doing ...
6 years, 5 months ago (2014-07-14 19:37:56 UTC) #11
erikchen
https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm File content/browser/cocoa/system_hotkey_map.mm (right): https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm#newcode121 content/browser/cocoa/system_hotkey_map.mm:121: std::vector<SystemHotkey>::const_iterator it; On 2014/07/14 19:37:56, rsesek wrote: > It ...
6 years, 5 months ago (2014-07-14 19:54:14 UTC) #12
erikchen
isherman: Looking for an OWNER review of tools/metrics/histograms/histograms.xml
6 years, 5 months ago (2014-07-14 19:56:17 UTC) #13
Robert Sesek
https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm File content/browser/cocoa/system_hotkey_map.mm (right): https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm#newcode121 content/browser/cocoa/system_hotkey_map.mm:121: std::vector<SystemHotkey>::const_iterator it; On 2014/07/14 19:54:14, erikchen1 wrote: > On ...
6 years, 5 months ago (2014-07-14 19:59:45 UTC) #14
erikchen
https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm File content/browser/cocoa/system_hotkey_map.mm (right): https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_map.mm#newcode121 content/browser/cocoa/system_hotkey_map.mm:121: std::vector<SystemHotkey>::const_iterator it; On 2014/07/14 19:59:45, rsesek wrote: > On ...
6 years, 5 months ago (2014-07-14 20:13:33 UTC) #15
Ilya Sherman
metrics LGTM with a suggestion: https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_helper_mac.mm File content/browser/cocoa/system_hotkey_helper_mac.mm (right): https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_helper_mac.mm#newcode73 content/browser/cocoa/system_hotkey_helper_mac.mm:73: UMA_HISTOGRAM_BOOLEAN("OSX.SystemHotkeyMap.Load", success); Optional nit: ...
6 years, 5 months ago (2014-07-15 00:49:56 UTC) #16
erikchen
https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_helper_mac.mm File content/browser/cocoa/system_hotkey_helper_mac.mm (right): https://codereview.chromium.org/370293004/diff/240001/content/browser/cocoa/system_hotkey_helper_mac.mm#newcode73 content/browser/cocoa/system_hotkey_helper_mac.mm:73: UMA_HISTOGRAM_BOOLEAN("OSX.SystemHotkeyMap.Load", success); On 2014/07/15 00:49:55, Ilya Sherman wrote: > ...
6 years, 5 months ago (2014-07-15 02:45:36 UTC) #17
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 5 months ago (2014-07-15 02:45:40 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/370293004/260001
6 years, 5 months ago (2014-07-15 02:47:18 UTC) #19
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-15 23:50:28 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-16 00:26:28 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/170794)
6 years, 5 months ago (2014-07-16 00:26:30 UTC) #22
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 5 months ago (2014-07-16 15:27:04 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/370293004/260001
6 years, 5 months ago (2014-07-16 15:29:32 UTC) #24
commit-bot: I haz the power
6 years, 5 months ago (2014-07-16 15:53:40 UTC) #25
Message was sent while issue was closed.
Change committed as 283405

Powered by Google App Engine
This is Rietveld 408576698