Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: chrome/common/custom_handlers/protocol_handler.cc

Issue 10559049: Add ToString method for easy DLOG and debug support (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "net/base/escape.h" 9 #include "net/base/escape.h"
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 title_ == other.title_; 76 title_ == other.title_;
77 } 77 }
78 78
79 bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const { 79 bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const {
80 return protocol_ == other.protocol_ && url_ == other.url_; 80 return protocol_ == other.protocol_ && url_ == other.url_;
81 } 81 }
82 82
83 bool ProtocolHandler::operator<(const ProtocolHandler& other) const { 83 bool ProtocolHandler::operator<(const ProtocolHandler& other) const {
84 return title_ < other.title_; 84 return title_ < other.title_;
85 } 85 }
86
87 std::ostream& operator<<(std::ostream& os, const ProtocolHandler& handler) {
88 return os << "{ " <<
89 " protocol=" << handler.protocol() <<
90 " url=" << handler.url() <<
91 " title=" << UTF16ToUTF8(handler.title()) <<
92 " }";
93 }
benwells 2012/06/22 19:47:48 nit: chrome style is to put the << at the beginnin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698