| 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 "chrome/browser/extensions/pending_extension_info.h" | 5 #include "chrome/browser/extensions/pending_extension_info.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace extensions { | 9 namespace extensions { |
| 10 | 10 |
| 11 PendingExtensionInfo::PendingExtensionInfo( | 11 PendingExtensionInfo::PendingExtensionInfo( |
| 12 const std::string& id, | 12 const std::string& id, |
| 13 const std::string& install_parameter, | 13 const std::string& install_parameter, |
| 14 const GURL& update_url, | 14 const GURL& update_url, |
| 15 const Version& version, | 15 const Version& version, |
| 16 ShouldAllowInstallPredicate should_allow_install, | 16 ShouldAllowInstallPredicate should_allow_install, |
| 17 bool is_from_sync, | 17 bool is_from_sync, |
| 18 bool install_silently, | 18 bool install_silently, |
| 19 Manifest::Location install_source, | 19 Manifest::Location install_source, |
| 20 int creation_flags, | 20 int creation_flags, |
| 21 bool mark_acknowledged) | 21 bool mark_acknowledged, |
| 22 bool remote_install) |
| 22 : id_(id), | 23 : id_(id), |
| 23 update_url_(update_url), | 24 update_url_(update_url), |
| 24 version_(version), | 25 version_(version), |
| 25 install_parameter_(install_parameter), | 26 install_parameter_(install_parameter), |
| 26 should_allow_install_(should_allow_install), | 27 should_allow_install_(should_allow_install), |
| 27 is_from_sync_(is_from_sync), | 28 is_from_sync_(is_from_sync), |
| 28 install_silently_(install_silently), | 29 install_silently_(install_silently), |
| 29 install_source_(install_source), | 30 install_source_(install_source), |
| 30 creation_flags_(creation_flags), | 31 creation_flags_(creation_flags), |
| 31 mark_acknowledged_(mark_acknowledged) {} | 32 mark_acknowledged_(mark_acknowledged), |
| 33 remote_install_(remote_install) { |
| 34 } |
| 32 | 35 |
| 33 PendingExtensionInfo::PendingExtensionInfo() | 36 PendingExtensionInfo::PendingExtensionInfo() |
| 34 : update_url_(), | 37 : update_url_(), |
| 35 should_allow_install_(NULL), | 38 should_allow_install_(NULL), |
| 36 is_from_sync_(true), | 39 is_from_sync_(true), |
| 37 install_silently_(false), | 40 install_silently_(false), |
| 38 install_source_(Manifest::INVALID_LOCATION) {} | 41 install_source_(Manifest::INVALID_LOCATION), |
| 42 creation_flags_(0), |
| 43 mark_acknowledged_(false), |
| 44 remote_install_(false) { |
| 45 } |
| 39 | 46 |
| 40 PendingExtensionInfo::~PendingExtensionInfo() {} | 47 PendingExtensionInfo::~PendingExtensionInfo() {} |
| 41 | 48 |
| 42 bool PendingExtensionInfo::operator==(const PendingExtensionInfo& rhs) const { | 49 bool PendingExtensionInfo::operator==(const PendingExtensionInfo& rhs) const { |
| 43 return id_ == rhs.id_; | 50 return id_ == rhs.id_; |
| 44 } | 51 } |
| 45 | 52 |
| 46 int PendingExtensionInfo::CompareTo(const PendingExtensionInfo& other) const { | 53 int PendingExtensionInfo::CompareTo(const PendingExtensionInfo& other) const { |
| 47 DCHECK_EQ(id_, other.id_); | 54 DCHECK_EQ(id_, other.id_); |
| 48 if (version_.IsValid() && other.version_.IsValid()) { | 55 if (version_.IsValid() && other.version_.IsValid()) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 // Different install sources; |this| has higher precedence if | 70 // Different install sources; |this| has higher precedence if |
| 64 // |install_source_| is the higher priority source. | 71 // |install_source_| is the higher priority source. |
| 65 Manifest::Location higher_priority_source = | 72 Manifest::Location higher_priority_source = |
| 66 Manifest::GetHigherPriorityLocation( | 73 Manifest::GetHigherPriorityLocation( |
| 67 install_source_, other.install_source_); | 74 install_source_, other.install_source_); |
| 68 | 75 |
| 69 return higher_priority_source == install_source_ ? 1 : -1; | 76 return higher_priority_source == install_source_ ? 1 : -1; |
| 70 } | 77 } |
| 71 | 78 |
| 72 } // namespace extensions | 79 } // namespace extensions |
| OLD | NEW |