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_BACKGROUND_INFO_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_BACKGROUND_INFO_H_ |
6 #define CHROME_COMMON_EXTENSIONS_BACKGROUND_INFO_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_BACKGROUND_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
13 #include "extensions/common/manifest_handler.h" | 13 #include "extensions/common/manifest_handler.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // True if the background page should stay loaded forever; false if it should | 65 // True if the background page should stay loaded forever; false if it should |
66 // load on-demand (when it needs to handle an event). Defaults to true. | 66 // load on-demand (when it needs to handle an event). Defaults to true. |
67 bool is_persistent_; | 67 bool is_persistent_; |
68 | 68 |
69 // True if the background page can be scripted by pages of the app or | 69 // True if the background page can be scripted by pages of the app or |
70 // extension, in which case all such pages must run in the same process. | 70 // extension, in which case all such pages must run in the same process. |
71 // False if such pages are not permitted to script the background page, | 71 // False if such pages are not permitted to script the background page, |
72 // allowing them to run in different processes. | 72 // allowing them to run in different processes. |
73 // Defaults to true. | 73 // Defaults to true. |
74 bool allow_js_access_; | 74 bool allow_js_access_; |
| 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(BackgroundInfo); |
75 }; | 77 }; |
76 | 78 |
77 // Parses all background/event page-related keys in the manifest. | 79 // Parses all background/event page-related keys in the manifest. |
78 class BackgroundManifestHandler : public ManifestHandler { | 80 class BackgroundManifestHandler : public ManifestHandler { |
79 public: | 81 public: |
80 BackgroundManifestHandler(); | 82 BackgroundManifestHandler(); |
81 virtual ~BackgroundManifestHandler(); | 83 virtual ~BackgroundManifestHandler(); |
82 | 84 |
83 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; | 85 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
84 virtual bool Validate(const Extension* extension, | 86 virtual bool Validate(const Extension* extension, |
85 std::string* error, | 87 std::string* error, |
86 std::vector<InstallWarning>* warnings) const OVERRIDE; | 88 std::vector<InstallWarning>* warnings) const OVERRIDE; |
87 virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE; | 89 virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE; |
88 | 90 |
89 private: | 91 private: |
90 virtual const std::vector<std::string> Keys() const OVERRIDE; | 92 virtual const std::vector<std::string> Keys() const OVERRIDE; |
| 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(BackgroundManifestHandler); |
91 }; | 95 }; |
92 | 96 |
93 } // namespace extensions | 97 } // namespace extensions |
94 | 98 |
95 #endif // CHROME_COMMON_EXTENSIONS_BACKGROUND_INFO_H_ | 99 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_BACKGROUND_INFO_H_ |
OLD | NEW |