| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/common/extensions/manifest.h" | 5 #include "chrome/common/extensions/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/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 type_(Extension::TYPE_UNKNOWN) { | 26 type_(Extension::TYPE_UNKNOWN) { |
| 27 if (value_->HasKey(keys::kTheme)) { | 27 if (value_->HasKey(keys::kTheme)) { |
| 28 type_ = Extension::TYPE_THEME; | 28 type_ = Extension::TYPE_THEME; |
| 29 } else if (value_->HasKey(keys::kApp)) { | 29 } else if (value_->HasKey(keys::kApp)) { |
| 30 if (value_->Get(keys::kWebURLs, NULL) || | 30 if (value_->Get(keys::kWebURLs, NULL) || |
| 31 value_->Get(keys::kLaunchWebURL, NULL)) { | 31 value_->Get(keys::kLaunchWebURL, NULL)) { |
| 32 type_ = Extension::TYPE_HOSTED_APP; | 32 type_ = Extension::TYPE_HOSTED_APP; |
| 33 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) { | 33 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) { |
| 34 type_ = Extension::TYPE_PLATFORM_APP; | 34 type_ = Extension::TYPE_PLATFORM_APP; |
| 35 } else { | 35 } else { |
| 36 type_ = Extension::TYPE_PACKAGED_APP; | 36 type_ = Extension::TYPE_LEGACY_PACKAGED_APP; |
| 37 } | 37 } |
| 38 } else { | 38 } else { |
| 39 type_ = Extension::TYPE_EXTENSION; | 39 type_ = Extension::TYPE_EXTENSION; |
| 40 } | 40 } |
| 41 CHECK_NE(type_, Extension::TYPE_UNKNOWN); | 41 CHECK_NE(type_, Extension::TYPE_UNKNOWN); |
| 42 } | 42 } |
| 43 | 43 |
| 44 Manifest::~Manifest() { | 44 Manifest::~Manifest() { |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 SimpleFeatureProvider::GetManifestFeatures()->GetFeature(key); | 170 SimpleFeatureProvider::GetManifestFeatures()->GetFeature(key); |
| 171 if (!feature) | 171 if (!feature) |
| 172 return true; | 172 return true; |
| 173 | 173 |
| 174 return feature->IsAvailableToManifest( | 174 return feature->IsAvailableToManifest( |
| 175 extension_id_, type_, Feature::ConvertLocation(location_), | 175 extension_id_, type_, Feature::ConvertLocation(location_), |
| 176 GetManifestVersion()).is_available(); | 176 GetManifestVersion()).is_available(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace extensions | 179 } // namespace extensions |
| OLD | NEW |