| 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/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Highest rank has highest priority. | 99 // Highest rank has highest priority. |
| 100 return (loc1_rank > loc2_rank ? loc1 : loc2 ); | 100 return (loc1_rank > loc2_rank ? loc1 : loc2 ); |
| 101 } | 101 } |
| 102 | 102 |
| 103 Manifest::Manifest(Location location, scoped_ptr<base::DictionaryValue> value) | 103 Manifest::Manifest(Location location, scoped_ptr<base::DictionaryValue> value) |
| 104 : location_(location), | 104 : location_(location), |
| 105 value_(value.Pass()), | 105 value_(value.Pass()), |
| 106 type_(TYPE_UNKNOWN) { | 106 type_(TYPE_UNKNOWN) { |
| 107 if (value_->HasKey(keys::kTheme)) { | 107 if (value_->HasKey(keys::kTheme)) { |
| 108 type_ = TYPE_THEME; | 108 type_ = TYPE_THEME; |
| 109 } else if (value_->HasKey(keys::kExport)) { |
| 110 type_ = TYPE_SHARED_MODULE; |
| 109 } else if (value_->HasKey(keys::kApp)) { | 111 } else if (value_->HasKey(keys::kApp)) { |
| 110 if (value_->Get(keys::kWebURLs, NULL) || | 112 if (value_->Get(keys::kWebURLs, NULL) || |
| 111 value_->Get(keys::kLaunchWebURL, NULL)) { | 113 value_->Get(keys::kLaunchWebURL, NULL)) { |
| 112 type_ = TYPE_HOSTED_APP; | 114 type_ = TYPE_HOSTED_APP; |
| 113 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) { | 115 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) { |
| 114 type_ = TYPE_PLATFORM_APP; | 116 type_ = TYPE_PLATFORM_APP; |
| 115 } else { | 117 } else { |
| 116 type_ = TYPE_LEGACY_PACKAGED_APP; | 118 type_ = TYPE_LEGACY_PACKAGED_APP; |
| 117 } | 119 } |
| 118 } else { | 120 } else { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 BaseFeatureProvider::GetByName("manifest")->GetFeature(key); | 252 BaseFeatureProvider::GetByName("manifest")->GetFeature(key); |
| 251 if (!feature) | 253 if (!feature) |
| 252 return true; | 254 return true; |
| 253 | 255 |
| 254 return feature->IsAvailableToManifest( | 256 return feature->IsAvailableToManifest( |
| 255 extension_id_, type_, Feature::ConvertLocation(location_), | 257 extension_id_, type_, Feature::ConvertLocation(location_), |
| 256 GetManifestVersion()).is_available(); | 258 GetManifestVersion()).is_available(); |
| 257 } | 259 } |
| 258 | 260 |
| 259 } // namespace extensions | 261 } // namespace extensions |
| OLD | NEW |