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

Side by Side Diff: chrome/browser/ui/extensions/accelerator_priority.h

Issue 360423002: Allow WebContents key handling to supplant extension overrides of the bookmark shortcut (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: rebase Created 6 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // The accelerator priority functions are intended to distinguish between
6 // accelerators that should preserve the built-in Chrome keybinding semantics
7 // (normal) and accelerators that should always override web page key handling
8 // (high). High priority is used for all accelerators assigned to extensions,
9 // except for the Ctrl+D bookmarking shortcut which is assigned normal priority
10 // when bound by an extension that requests the privilege to override the
11 // bookmark UI. This is currently the only case where we allow an extension to
12 // replace a built-in Chrome accelerator, and it should have the same behavior
13 // as the built-in accelerator.
14
15 #ifndef CHROME_BROWSER_UI_EXTENSIONS_ACCELERATOR_PRIORITY_H_
16 #define CHROME_BROWSER_UI_EXTENSIONS_ACCELERATOR_PRIORITY_H_
17
18 #include <string>
19
20 #include "ui/base/accelerators/accelerator_manager.h"
21
22 namespace content {
23 class BrowserContext;
24 }
25
26 namespace extensions {
27 class Extension;
28 }
29
30 namespace ui {
31 class Accelerator;
32 }
33
34 // Returns the registration priority to be used when registering |accelerator|
35 // for |extension|.
36 ui::AcceleratorManager::HandlerPriority GetAcceleratorPriority(
37 const ui::Accelerator& accelerator,
38 const extensions::Extension* extension);
39
40 // Returns the registration priority to be used when registering |accelerator|
41 // for the extension with ID |extension_id|.
42 ui::AcceleratorManager::HandlerPriority GetAcceleratorPriorityById(
43 const ui::Accelerator& accelerator,
44 const std::string& extension_id,
45 content::BrowserContext* browser_context);
46
47 #endif // CHROME_BROWSER_UI_EXTENSIONS_ACCELERATOR_PRIORITY_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_keybinding_registry.h ('k') | chrome/browser/ui/extensions/accelerator_priority.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698