1 // Copyright 2013 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.
5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_
8 #include "chrome/common/extensions/api/manifest_types.h"
9 #include "extensions/common/extension.h"
10 #include "extensions/common/manifest_handler.h"
12 namespace extensions
{
14 class ManifestPermission
;
16 // UIOverrides is associated with "chrome_ui_overrides" manifest key, and
17 // represents manifest settings to override aspects of the Chrome user
19 struct UIOverrides
: public Extension::ManifestData
{
21 ~UIOverrides() override
;
23 static const UIOverrides
* Get(const Extension
* extension
);
25 static bool RemovesBookmarkButton(const Extension
* extension
);
26 static bool RemovesBookmarkShortcut(const Extension
* extension
);
27 static bool RemovesBookmarkOpenPagesShortcut(const Extension
* extension
);
29 scoped_ptr
<api::manifest_types::ChromeUIOverrides::Bookmarks_ui
> bookmarks_ui
;
31 scoped_ptr
<ManifestPermission
> manifest_permission
;
34 DISALLOW_COPY_AND_ASSIGN(UIOverrides
);
37 class UIOverridesHandler
: public ManifestHandler
{
40 ~UIOverridesHandler() override
;
42 bool Parse(Extension
* extension
, base::string16
* error
) override
;
43 bool Validate(const Extension
* extension
,
45 std::vector
<InstallWarning
>* warnings
) const override
;
47 ManifestPermission
* CreatePermission() override
;
48 ManifestPermission
* CreateInitialRequiredPermission(
49 const Extension
* extension
) override
;
52 class ManifestPermissionImpl
;
54 const std::vector
<std::string
> Keys() const override
;
56 DISALLOW_COPY_AND_ASSIGN(UIOverridesHandler
);
59 } // namespace extensions
60 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_