Chromium Code Reviews| Index: content/browser/cocoa/system_hotkey_map.mm |
| diff --git a/content/browser/cocoa/system_hotkey_map.mm b/content/browser/cocoa/system_hotkey_map.mm |
| index da04fa8b8442c66fa5c47410c25adeb2190fd3df..036d57b4c493c87956febda663a91f79c155d892 100644 |
| --- a/content/browser/cocoa/system_hotkey_map.mm |
| +++ b/content/browser/cocoa/system_hotkey_map.mm |
| @@ -33,6 +33,17 @@ NSString* StringForKey(NSDictionary* dict, NSString* key) { |
| return ObjectForKey(dict, key, [NSString class]); |
| } |
| +NSDictionary* kDefaultSymbolicHotKeys = @{ |
| + // Default Window switch key binding: Command + ` |
| + @"27" : @{ |
| + @"enabled" : @YES, |
| + @"value" : @{ |
| + @"type" : @"standard", |
| + @"parameters" : @[ @96, @50, @1048576 ], |
|
erikchen
2016/04/01 03:55:12
Where did these numbers come from?
chongz
2016/04/01 19:47:18
They come from my local file, replaced with meanin
|
| + } |
| + } |
| +}; |
| + |
| } // namespace |
| #pragma mark - SystemHotkey |
| @@ -75,11 +86,17 @@ bool SystemHotkeyMap::ParseDictionary(NSDictionary* dictionary) { |
| if (!dictionary) |
| return false; |
| - NSDictionary* hotkey_dictionaries = |
| + NSDictionary* user_hotkey_dictionaries = |
| DictionaryForKey(dictionary, @"AppleSymbolicHotKeys"); |
| - if (!hotkey_dictionaries) |
| + if (!user_hotkey_dictionaries) |
| return false; |
| + // Safe for user disabled hotkeys. If a hotkey was disabled it will have |
|
erikchen
2016/04/01 03:55:11
I don't understand your comment. I think you are t
chongz
2016/04/01 19:47:18
Done. I was trying to emphasize that not only modi
|
| + // |enabled| set to "NO" instead of removed from |user_hotkey_dictionaries|. |
|
erikchen
2016/04/01 03:55:11
Add a link to https://bugs.chromium.org/p/chromium
chongz
2016/04/01 19:47:18
Done.
|
| + NSMutableDictionary* hotkey_dictionaries = |
| + [kDefaultSymbolicHotKeys mutableCopy]; |
|
erikchen
2016/04/01 03:55:12
You are leaking a reference. Use scoped_nsobject.
chongz
2016/04/01 19:47:17
Done.
|
| + [hotkey_dictionaries addEntriesFromDictionary:user_hotkey_dictionaries]; |
| + |
| for (NSString* hotkey_system_effect in [hotkey_dictionaries allKeys]) { |
| if (![hotkey_system_effect isKindOfClass:[NSString class]]) |
| continue; |