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

Side by Side Diff: chrome/browser/ui/cocoa/accelerator_utils_cocoa.mm

Issue 143493005: Allow extensions to remove and override the bookmark shortcut key (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 GetChromeAcceleratorForCommandId(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698