Chromium Code Reviews| Index: chrome/common/extensions/api/extension_action/browser_action_handler.h |
| diff --git a/chrome/common/extensions/api/extension_action/browser_action_handler.h b/chrome/common/extensions/api/extension_action/browser_action_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..05aa6f7622adad0c43a6d820f81e40e20f4c663d |
| --- /dev/null |
| +++ b/chrome/common/extensions/api/extension_action/browser_action_handler.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_BROWSER_ACTION_HANDLER_H_ |
| +#define CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_BROWSER_ACTION_HANDLER_H_ |
| + |
| +#include <string> |
| + |
| +#include "chrome/common/extensions/api/extension_action/action_info.h" |
| +#include "chrome/common/extensions/extension.h" |
| +#include "chrome/common/extensions/manifest_handler.h" |
| + |
| +namespace extensions { |
| + |
| +struct BrowserActionInfo : public Extension::ManifestData { |
|
Yoyo Zhou
2012/12/21 23:50:59
I'm not sure that we need different wrapper types
Devlin
2012/12/27 20:36:46
Done.
|
| + explicit BrowserActionInfo(ActionInfo* action_info); |
| + virtual ~BrowserActionInfo(); |
| + |
| + // The extension's browser action, if any. |
| + scoped_ptr<ActionInfo> browser_action_info; |
| + |
| + // Returns the browser action for the extension. |
| + static const ActionInfo* GetBrowserAction( |
| + const Extension* extension); |
| +}; |
| + |
| +// Parses the "browser_action" manifest key. |
| +class BrowserActionHandler : public ManifestHandler { |
| + public: |
| + BrowserActionHandler(); |
| + virtual ~BrowserActionHandler(); |
| + |
| + virtual bool Parse(const base::Value* value, |
| + Extension* extension, |
| + string16* error) OVERRIDE; |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_BROWSER_ACTION_HANDLER_H_ |