| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/extension.h" | 5 #include "extensions/common/extension.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 name_ = base::UTF16ToUTF8(localized_name); | 572 name_ = base::UTF16ToUTF8(localized_name); |
| 573 return true; | 573 return true; |
| 574 } | 574 } |
| 575 | 575 |
| 576 bool Extension::LoadVersion(base::string16* error) { | 576 bool Extension::LoadVersion(base::string16* error) { |
| 577 std::string version_str; | 577 std::string version_str; |
| 578 if (!manifest_->GetString(keys::kVersion, &version_str)) { | 578 if (!manifest_->GetString(keys::kVersion, &version_str)) { |
| 579 *error = base::ASCIIToUTF16(errors::kInvalidVersion); | 579 *error = base::ASCIIToUTF16(errors::kInvalidVersion); |
| 580 return false; | 580 return false; |
| 581 } | 581 } |
| 582 version_.reset(new Version(version_str)); | 582 version_.reset(new base::Version(version_str)); |
| 583 if (!version_->IsValid() || version_->components().size() > 4) { | 583 if (!version_->IsValid() || version_->components().size() > 4) { |
| 584 *error = base::ASCIIToUTF16(errors::kInvalidVersion); | 584 *error = base::ASCIIToUTF16(errors::kInvalidVersion); |
| 585 return false; | 585 return false; |
| 586 } | 586 } |
| 587 if (manifest_->HasKey(keys::kVersionName)) { | 587 if (manifest_->HasKey(keys::kVersionName)) { |
| 588 if (!manifest_->GetString(keys::kVersionName, &version_name_)) { | 588 if (!manifest_->GetString(keys::kVersionName, &version_name_)) { |
| 589 *error = base::ASCIIToUTF16(errors::kInvalidVersionName); | 589 *error = base::ASCIIToUTF16(errors::kInvalidVersionName); |
| 590 return false; | 590 return false; |
| 591 } | 591 } |
| 592 } | 592 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 : reason(reason), | 776 : reason(reason), |
| 777 extension(extension) {} | 777 extension(extension) {} |
| 778 | 778 |
| 779 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 779 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 780 const Extension* extension, | 780 const Extension* extension, |
| 781 const PermissionSet& permissions, | 781 const PermissionSet& permissions, |
| 782 Reason reason) | 782 Reason reason) |
| 783 : reason(reason), extension(extension), permissions(permissions) {} | 783 : reason(reason), extension(extension), permissions(permissions) {} |
| 784 | 784 |
| 785 } // namespace extensions | 785 } // namespace extensions |
| OLD | NEW |