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

Side by Side Diff: extensions/common/manifest.cc

Issue 178253007: Parse manifest file with app.service_worker.script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved test utils out of base Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/manifest_unittest.cc ('k') | extensions/common/manifest_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "extensions/common/manifest.h" 5 #include "extensions/common/manifest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 value_(value.Pass()), 113 value_(value.Pass()),
114 type_(TYPE_UNKNOWN) { 114 type_(TYPE_UNKNOWN) {
115 if (value_->HasKey(keys::kTheme)) { 115 if (value_->HasKey(keys::kTheme)) {
116 type_ = TYPE_THEME; 116 type_ = TYPE_THEME;
117 } else if (value_->HasKey(keys::kExport)) { 117 } else if (value_->HasKey(keys::kExport)) {
118 type_ = TYPE_SHARED_MODULE; 118 type_ = TYPE_SHARED_MODULE;
119 } else if (value_->HasKey(keys::kApp)) { 119 } else if (value_->HasKey(keys::kApp)) {
120 if (value_->Get(keys::kWebURLs, NULL) || 120 if (value_->Get(keys::kWebURLs, NULL) ||
121 value_->Get(keys::kLaunchWebURL, NULL)) { 121 value_->Get(keys::kLaunchWebURL, NULL)) {
122 type_ = TYPE_HOSTED_APP; 122 type_ = TYPE_HOSTED_APP;
123 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) { 123 } else if (value_->Get(keys::kPlatformAppBackground, NULL) ||
124 value_->Get(keys::kPlatformAppServiceWorker, NULL)) {
124 type_ = TYPE_PLATFORM_APP; 125 type_ = TYPE_PLATFORM_APP;
125 } else { 126 } else {
126 type_ = TYPE_LEGACY_PACKAGED_APP; 127 type_ = TYPE_LEGACY_PACKAGED_APP;
127 } 128 }
128 } else { 129 } else {
129 type_ = TYPE_EXTENSION; 130 type_ = TYPE_EXTENSION;
130 } 131 }
131 CHECK_NE(type_, TYPE_UNKNOWN); 132 CHECK_NE(type_, TYPE_UNKNOWN);
132 } 133 }
133 134
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 Feature* feature = FeatureProvider::GetManifestFeatures()->GetFeature(key); 258 Feature* feature = FeatureProvider::GetManifestFeatures()->GetFeature(key);
258 if (!feature) 259 if (!feature)
259 return true; 260 return true;
260 261
261 return feature->IsAvailableToManifest( 262 return feature->IsAvailableToManifest(
262 extension_id_, type_, Feature::ConvertLocation(location_), 263 extension_id_, type_, Feature::ConvertLocation(location_),
263 GetManifestVersion()).is_available(); 264 GetManifestVersion()).is_available();
264 } 265 }
265 266
266 } // namespace extensions 267 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_unittest.cc ('k') | extensions/common/manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698