| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 #include "chrome/browser/ui/cocoa/accelerators_cocoa.h" | 6 #include "chrome/browser/ui/cocoa/accelerators_cocoa.h" |
| 7 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 7 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 8 #include "content/public/browser/native_web_keyboard_event.h" | 8 #include "content/public/browser/native_web_keyboard_event.h" |
| 9 #include "ui/base/accelerators/accelerator.h" | 9 #include "ui/base/accelerators/accelerator.h" |
| 10 #import "ui/base/accelerators/platform_accelerator_cocoa.h" | 10 #import "ui/base/accelerators/platform_accelerator_cocoa.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 characters:characters | 43 characters:characters |
| 44 charactersIgnoringModifiers:characters | 44 charactersIgnoringModifiers:characters |
| 45 isARepeat:NO | 45 isARepeat:NO |
| 46 keyCode:accelerator.key_code()]; | 46 keyCode:accelerator.key_code()]; |
| 47 | 47 |
| 48 content::NativeWebKeyboardEvent keyboard_event(event); | 48 content::NativeWebKeyboardEvent keyboard_event(event); |
| 49 int id = [BrowserWindowUtils getCommandId:keyboard_event]; | 49 int id = [BrowserWindowUtils getCommandId:keyboard_event]; |
| 50 return id != -1; | 50 return id != -1; |
| 51 } | 51 } |
| 52 | 52 |
| 53 ui::Accelerator GetPrimaryChromeAcceleratorForCommandId(int command_id) { |
| 54 const ui::Accelerator* accelerator = |
| 55 AcceleratorsCocoa::GetInstance()->GetAcceleratorForCommand(command_id); |
| 56 |
| 57 return accelerator ? *accelerator : ui::Accelerator(); |
| 58 } |
| 59 |
| 53 } // namespace chrome | 60 } // namespace chrome |
| OLD | NEW |