| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/api/declarative/rule_identifier.h" |
| 6 |
| 7 namespace extensions { |
| 8 |
| 9 RuleIdentifier::RuleIdentifier(const std::string& extension_id, |
| 10 const std::string& rule_id) |
| 11 : extension_id_(extension_id), |
| 12 rule_id_(rule_id) {} |
| 13 |
| 14 RuleIdentifier::RuleIdentifier(const RuleIdentifier& other) |
| 15 : extension_id_(other.extension_id_), |
| 16 rule_id_(other.rule_id_) {} |
| 17 |
| 18 RuleIdentifier::~RuleIdentifier() {} |
| 19 |
| 20 bool RuleIdentifier::operator<(const RuleIdentifier& other) const { |
| 21 // These are ordered so that the elements with most entropy are compared |
| 22 // first. |
| 23 if (rule_id_ < other.rule_id_) return true; |
| 24 if (rule_id_ > other.rule_id_) return false; |
| 25 if (extension_id_ < other.extension_id_) return true; |
| 26 return false; |
| 27 } |
| 28 |
| 29 RuleIdentifier& RuleIdentifier::operator=(const RuleIdentifier& other) { |
| 30 extension_id_ = other.extension_id_; |
| 31 rule_id_ = other.rule_id_; |
| 32 return *this; |
| 33 } |
| 34 |
| 35 } // extensions |
| OLD | NEW |