| 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 #ifndef CHROME_COMMON_EXTENSIONS_API_COMMANDS_COMMANDS_HANDLER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_COMMANDS_COMMANDS_HANDLER_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_COMMANDS_COMMANDS_HANDLER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_COMMANDS_COMMANDS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 static const Command* GetScriptBadgeCommand(const Extension* extension); | 32 static const Command* GetScriptBadgeCommand(const Extension* extension); |
| 33 static const CommandMap* GetNamedCommands(const Extension* extension); | 33 static const CommandMap* GetNamedCommands(const Extension* extension); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Parses the "commands" manifest key. | 36 // Parses the "commands" manifest key. |
| 37 class CommandsHandler : public ManifestHandler { | 37 class CommandsHandler : public ManifestHandler { |
| 38 public: | 38 public: |
| 39 CommandsHandler(); | 39 CommandsHandler(); |
| 40 virtual ~CommandsHandler(); | 40 virtual ~CommandsHandler(); |
| 41 | 41 |
| 42 virtual bool Parse(const base::Value* value, | 42 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
| 43 Extension* extension, | 43 virtual bool AlwaysParseForType(Extension::Type type) OVERRIDE; |
| 44 string16* error) OVERRIDE; | |
| 45 | |
| 46 virtual bool HasNoKey(Extension* extension, string16* error) OVERRIDE; | |
| 47 | 44 |
| 48 private: | 45 private: |
| 49 // If the extension defines a browser action, but no command for it, then | 46 // If the extension defines a browser action, but no command for it, then |
| 50 // we synthesize a generic one, so the user can configure a shortcut for it. | 47 // we synthesize a generic one, so the user can configure a shortcut for it. |
| 51 // No keyboard shortcut will be assigned to it, until the user selects one. | 48 // No keyboard shortcut will be assigned to it, until the user selects one. |
| 52 void MaybeSetBrowserActionDefault(const Extension* extension, | 49 void MaybeSetBrowserActionDefault(const Extension* extension, |
| 53 CommandsInfo* info); | 50 CommandsInfo* info); |
| 54 }; | 51 }; |
| 55 | 52 |
| 56 } // namespace extensions | 53 } // namespace extensions |
| 57 | 54 |
| 58 #endif // CHROME_COMMON_EXTENSIONS_API_COMMANDS_COMMANDS_HANDLER_H_ | 55 #endif // CHROME_COMMON_EXTENSIONS_API_COMMANDS_COMMANDS_HANDLER_H_ |
| OLD | NEW |