OLD | NEW |
(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_ |
OLD | NEW |