OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_ |
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_ |
7 | 7 |
8 #include "chrome/common/extensions/api/manifest_types.h" | 8 #include "chrome/common/extensions/api/manifest_types.h" |
9 #include "extensions/common/extension.h" | 9 #include "extensions/common/extension.h" |
10 #include "extensions/common/manifest_handler.h" | 10 #include "extensions/common/manifest_handler.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 class ManifestPermission; | 14 class ManifestPermission; |
15 | 15 |
16 // SettingsOverride is associated with "chrome_settings_overrides" manifest key. | 16 // UIOverrides is associated with "chrome_ui_overrides" manifest key, and |
17 // An extension can add a search engine as default or non-default, overwrite the | 17 // represents manifest settings to override aspects of the Chrome user |
18 // homepage and append a startup page to the list. | 18 // interface. |
19 struct SettingsOverrides : public Extension::ManifestData { | 19 struct UIOverrides : public Extension::ManifestData { |
20 SettingsOverrides(); | 20 UIOverrides(); |
21 virtual ~SettingsOverrides(); | 21 virtual ~UIOverrides(); |
22 | 22 |
23 static const SettingsOverrides* Get(const Extension* extension); | 23 static const UIOverrides* Get(const Extension* extension); |
24 | 24 |
25 static bool RemovesBookmarkButton( | 25 static bool RemovesBookmarkButton( |
26 const SettingsOverrides& settings_overrides); | 26 const UIOverrides& ui_overrides); |
27 static bool RemovesBookmarkShortcut( | 27 static bool RemovesBookmarkShortcut( |
28 const SettingsOverrides& settings_overrides); | 28 const UIOverrides& ui_overrides); |
29 | 29 |
30 scoped_ptr<api::manifest_types::ChromeSettingsOverrides::Bookmarks_ui> | 30 scoped_ptr<api::manifest_types::ChromeUIOverrides::Bookmarks_ui> |
31 bookmarks_ui; | 31 bookmarks_ui; |
32 scoped_ptr<api::manifest_types::ChromeSettingsOverrides::Search_provider> | |
33 search_engine; | |
34 scoped_ptr<GURL> homepage; | |
35 std::vector<GURL> startup_pages; | |
36 | 32 |
37 scoped_ptr<ManifestPermission> manifest_permission; | 33 scoped_ptr<ManifestPermission> manifest_permission; |
38 | 34 |
39 private: | 35 private: |
40 DISALLOW_COPY_AND_ASSIGN(SettingsOverrides); | 36 DISALLOW_COPY_AND_ASSIGN(UIOverrides); |
41 }; | 37 }; |
42 | 38 |
43 class SettingsOverridesHandler : public ManifestHandler { | 39 class UIOverridesHandler : public ManifestHandler { |
44 public: | 40 public: |
45 SettingsOverridesHandler(); | 41 UIOverridesHandler(); |
46 virtual ~SettingsOverridesHandler(); | 42 virtual ~UIOverridesHandler(); |
47 | 43 |
48 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE; | 44 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE; |
49 virtual bool Validate(const Extension* extension, | 45 virtual bool Validate(const Extension* extension, |
50 std::string* error, | 46 std::string* error, |
51 std::vector<InstallWarning>* warnings) const OVERRIDE; | 47 std::vector<InstallWarning>* warnings) const OVERRIDE; |
52 | 48 |
53 virtual ManifestPermission* CreatePermission() OVERRIDE; | 49 virtual ManifestPermission* CreatePermission() OVERRIDE; |
54 virtual ManifestPermission* CreateInitialRequiredPermission( | 50 virtual ManifestPermission* CreateInitialRequiredPermission( |
55 const Extension* extension) OVERRIDE; | 51 const Extension* extension) OVERRIDE; |
56 | 52 |
57 private: | 53 private: |
58 class ManifestPermissionImpl; | 54 class ManifestPermissionImpl; |
59 | 55 |
60 virtual const std::vector<std::string> Keys() const OVERRIDE; | 56 virtual const std::vector<std::string> Keys() const OVERRIDE; |
61 | 57 |
62 DISALLOW_COPY_AND_ASSIGN(SettingsOverridesHandler); | 58 DISALLOW_COPY_AND_ASSIGN(UIOverridesHandler); |
63 }; | 59 }; |
64 | 60 |
65 } // namespace extensions | 61 } // namespace extensions |
66 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_ | 62 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_UI_OVERRIDES_HANDLER_H_ |
OLD | NEW |