Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6478)

Unified Diff: chrome/common/extensions/extension.cc

Issue 7645033: Add offline_enabled field in manifest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 1b623538d0ce3e7064f8213bb0938268844e8943..c91b568d50ea8d51b0e3eed1aeace07443e1a344 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1190,7 +1190,8 @@ bool Extension::EnsureNotHybridApp(const DictionaryValue* manifest,
*key != keys::kPermissions &&
*key != keys::kOptionalPermissions &&
*key != keys::kOptionsPage &&
- *key != keys::kBackground) {
+ *key != keys::kBackground &&
+ *key != keys::kOfflineEnabled) {
*error = ExtensionErrorUtils::FormatErrorMessage(
errors::kHostedAppsCannotIncludeExtensionFeatures, *key);
return false;
@@ -1208,6 +1209,7 @@ bool Extension::IsTrustedId(const std::string& id) {
Extension::Extension(const FilePath& path, Location location)
: incognito_split_mode_(false),
+ offline_enabled_(false),
location_(location),
converted_from_user_script_(false),
is_theme_(false),
@@ -1870,7 +1872,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
}
// Initialize options page url (optional).
- // Funtion LoadIsApp() set is_app_ above.
+ // Function LoadIsApp() set is_app_ above.
if (source.HasKey(keys::kOptionsPage)) {
std::string options_str;
if (!source.GetString(keys::kOptionsPage, &options_str)) {
@@ -2305,6 +2307,14 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
}
}
+ // Initialize offline-enabled status. Defaults to false.
+ if (source.HasKey(keys::kOfflineEnabled)) {
+ if (!source.GetBoolean(keys::kOfflineEnabled, &offline_enabled_)) {
+ *error = errors::kInvalidOfflineEnabled;
+ return false;
+ }
+ }
+
if (HasMultipleUISurfaces()) {
*error = errors::kOneUISurfaceOnly;
return false;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698