| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |