| Index: chrome/browser/extensions/api/declarative/rule_identifier.cc
|
| diff --git a/chrome/browser/extensions/api/declarative/rule_identifier.cc b/chrome/browser/extensions/api/declarative/rule_identifier.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..05871accb986ee2bcbd0ab4c192ed6d4b2675006
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/api/declarative/rule_identifier.cc
|
| @@ -0,0 +1,35 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/extensions/api/declarative/rule_identifier.h"
|
| +
|
| +namespace extensions {
|
| +
|
| +RuleIdentifier::RuleIdentifier(const std::string& extension_id,
|
| + const std::string& rule_id)
|
| + : extension_id_(extension_id),
|
| + rule_id_(rule_id) {}
|
| +
|
| +RuleIdentifier::RuleIdentifier(const RuleIdentifier& other)
|
| +: extension_id_(other.extension_id_),
|
| + rule_id_(other.rule_id_) {}
|
| +
|
| +RuleIdentifier::~RuleIdentifier() {}
|
| +
|
| +bool RuleIdentifier::operator<(const RuleIdentifier& other) const {
|
| + // These are ordered so that the elements with most entropy are compared
|
| + // first.
|
| + if (rule_id_ < other.rule_id_) return true;
|
| + if (rule_id_ > other.rule_id_) return false;
|
| + if (extension_id_ < other.extension_id_) return true;
|
| + return false;
|
| +}
|
| +
|
| +RuleIdentifier& RuleIdentifier::operator=(const RuleIdentifier& other) {
|
| + extension_id_ = other.extension_id_;
|
| + rule_id_ = other.rule_id_;
|
| + return *this;
|
| +}
|
| +
|
| +} // extensions
|
|
|