| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/common/custom_handlers/protocol_handler.h" | 5 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "net/base/escape.h" | 9 #include "net/base/escape.h" |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 d->Set("protocol", new base::StringValue(protocol_)); | 68 d->Set("protocol", new base::StringValue(protocol_)); |
| 69 d->Set("url", new base::StringValue(url_.spec())); | 69 d->Set("url", new base::StringValue(url_.spec())); |
| 70 d->Set("title", new base::StringValue(title_)); | 70 d->Set("title", new base::StringValue(title_)); |
| 71 return d; | 71 return d; |
| 72 } | 72 } |
| 73 | 73 |
| 74 #if !defined(NDEBUG) | 74 #if !defined(NDEBUG) |
| 75 std::string ProtocolHandler::ToString() const { | 75 std::string ProtocolHandler::ToString() const { |
| 76 return "{ protocol=" + protocol_ + | 76 return "{ protocol=" + protocol_ + |
| 77 ", url=" + url_.spec() + | 77 ", url=" + url_.spec() + |
| 78 ", title=" + UTF16ToASCII(title_) + | 78 ", title=" + base::UTF16ToASCII(title_) + |
| 79 " }"; | 79 " }"; |
| 80 } | 80 } |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 bool ProtocolHandler::operator==(const ProtocolHandler& other) const { | 83 bool ProtocolHandler::operator==(const ProtocolHandler& other) const { |
| 84 return protocol_ == other.protocol_ && | 84 return protocol_ == other.protocol_ && |
| 85 url_ == other.url_ && | 85 url_ == other.url_ && |
| 86 title_ == other.title_; | 86 title_ == other.title_; |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const { | 89 bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const { |
| 90 return protocol_ == other.protocol_ && url_ == other.url_; | 90 return protocol_ == other.protocol_ && url_ == other.url_; |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool ProtocolHandler::operator<(const ProtocolHandler& other) const { | 93 bool ProtocolHandler::operator<(const ProtocolHandler& other) const { |
| 94 return title_ < other.title_; | 94 return title_ < other.title_; |
| 95 } | 95 } |
| OLD | NEW |