| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/features/simple_feature.h" | 5 #include "extensions/common/features/simple_feature.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 266 } |
| 267 | 267 |
| 268 return CheckDependencies(base::Bind(&IsAvailableToManifestForBind, | 268 return CheckDependencies(base::Bind(&IsAvailableToManifestForBind, |
| 269 extension_id, | 269 extension_id, |
| 270 type, | 270 type, |
| 271 location, | 271 location, |
| 272 manifest_version, | 272 manifest_version, |
| 273 platform)); | 273 platform)); |
| 274 } | 274 } |
| 275 | 275 |
| 276 std::string SimpleFeature::GetAlias() const { |
| 277 return alias_; |
| 278 } |
| 279 |
| 280 std::string SimpleFeature::GetSource() const { |
| 281 return source_; |
| 282 } |
| 283 |
| 276 Feature::Availability SimpleFeature::IsAvailableToContext( | 284 Feature::Availability SimpleFeature::IsAvailableToContext( |
| 277 const Extension* extension, | 285 const Extension* extension, |
| 278 Feature::Context context, | 286 Feature::Context context, |
| 279 const GURL& url, | 287 const GURL& url, |
| 280 SimpleFeature::Platform platform) const { | 288 SimpleFeature::Platform platform) const { |
| 281 if (extension) { | 289 if (extension) { |
| 282 Availability result = IsAvailableToManifest(extension->id(), | 290 Availability result = IsAvailableToManifest(extension->id(), |
| 283 extension->GetType(), | 291 extension->GetType(), |
| 284 extension->location(), | 292 extension->location(), |
| 285 extension->manifest_version(), | 293 extension->manifest_version(), |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 | 567 |
| 560 void SimpleFeature::set_platforms(std::initializer_list<Platform> platforms) { | 568 void SimpleFeature::set_platforms(std::initializer_list<Platform> platforms) { |
| 561 platforms_ = platforms; | 569 platforms_ = platforms; |
| 562 } | 570 } |
| 563 | 571 |
| 564 void SimpleFeature::set_whitelist( | 572 void SimpleFeature::set_whitelist( |
| 565 std::initializer_list<const char* const> whitelist) { | 573 std::initializer_list<const char* const> whitelist) { |
| 566 whitelist_.assign(whitelist.begin(), whitelist.end()); | 574 whitelist_.assign(whitelist.begin(), whitelist.end()); |
| 567 } | 575 } |
| 568 | 576 |
| 577 void SimpleFeature::set_alias(base::StringPiece alias) { |
| 578 alias_ = alias.as_string(); |
| 579 } |
| 580 |
| 581 void SimpleFeature::set_source(base::StringPiece source) { |
| 582 source_ = source.as_string(); |
| 583 } |
| 569 } // namespace extensions | 584 } // namespace extensions |
| OLD | NEW |