| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_OMNIBOX_OMNIBOX_HANDLER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_OMNIBOX_OMNIBOX_HANDLER_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_OMNIBOX_OMNIBOX_HANDLER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_OMNIBOX_OMNIBOX_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "extensions/common/extension.h" |
| 11 #include "extensions/common/manifest_handler.h" | 11 #include "extensions/common/manifest_handler.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 class Extension; | 15 class Extension; |
| 16 | 16 |
| 17 struct OmniboxInfo : public Extension::ManifestData { | 17 struct OmniboxInfo : public Extension::ManifestData { |
| 18 // The Omnibox keyword for an extension. | 18 // The Omnibox keyword for an extension. |
| 19 std::string keyword; | 19 std::string keyword; |
| 20 | 20 |
| 21 // Returns the omnibox keyword for the extension. | 21 // Returns the omnibox keyword for the extension. |
| 22 static const std::string& GetKeyword(const Extension* extension); | 22 static const std::string& GetKeyword(const Extension* extension); |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // Parses the "omnibox" manifest key. | 25 // Parses the "omnibox" manifest key. |
| 26 class OmniboxHandler : public ManifestHandler { | 26 class OmniboxHandler : public ManifestHandler { |
| 27 public: | 27 public: |
| 28 OmniboxHandler(); | 28 OmniboxHandler(); |
| 29 virtual ~OmniboxHandler(); | 29 virtual ~OmniboxHandler(); |
| 30 | 30 |
| 31 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; | 31 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 virtual const std::vector<std::string> Keys() const OVERRIDE; | 34 virtual const std::vector<std::string> Keys() const OVERRIDE; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace extensions | 37 } // namespace extensions |
| 38 | 38 |
| 39 #endif // CHROME_COMMON_EXTENSIONS_API_OMNIBOX_OMNIBOX_HANDLER_H_ | 39 #endif // CHROME_COMMON_EXTENSIONS_API_OMNIBOX_OMNIBOX_HANDLER_H_ |
| OLD | NEW |