| 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)) { | |
| 125 type_ = TYPE_PLATFORM_APP; | 124 type_ = TYPE_PLATFORM_APP; |
| 126 } else { | 125 } else { |
| 127 type_ = TYPE_LEGACY_PACKAGED_APP; | 126 type_ = TYPE_LEGACY_PACKAGED_APP; |
| 128 } | 127 } |
| 129 } else { | 128 } else { |
| 130 type_ = TYPE_EXTENSION; | 129 type_ = TYPE_EXTENSION; |
| 131 } | 130 } |
| 132 CHECK_NE(type_, TYPE_UNKNOWN); | 131 CHECK_NE(type_, TYPE_UNKNOWN); |
| 133 } | 132 } |
| 134 | 133 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 Feature* feature = FeatureProvider::GetManifestFeatures()->GetFeature(key); | 256 Feature* feature = FeatureProvider::GetManifestFeatures()->GetFeature(key); |
| 258 if (!feature) | 257 if (!feature) |
| 259 return true; | 258 return true; |
| 260 | 259 |
| 261 return feature->IsAvailableToManifest( | 260 return feature->IsAvailableToManifest( |
| 262 extension_id_, type_, location_, GetManifestVersion()) | 261 extension_id_, type_, location_, GetManifestVersion()) |
| 263 .is_available(); | 262 .is_available(); |
| 264 } | 263 } |
| 265 | 264 |
| 266 } // namespace extensions | 265 } // namespace extensions |
| OLD | NEW |