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

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

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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
11 11
12 ProtocolHandler::ProtocolHandler(const std::string& protocol, 12 ProtocolHandler::ProtocolHandler(const std::string& protocol,
13 const GURL& url) 13 const GURL& url)
14 : protocol_(protocol), 14 : protocol_(protocol),
15 url_(url) { 15 url_(url) {
16 } 16 }
17 17
18 ProtocolHandler ProtocolHandler::CreateProtocolHandler( 18 ProtocolHandler ProtocolHandler::CreateProtocolHandler(
19 const std::string& protocol, 19 const std::string& protocol,
20 const GURL& url) { 20 const GURL& url) {
21 std::string lower_protocol = StringToLowerASCII(protocol); 21 std::string lower_protocol = base::StringToLowerASCII(protocol);
22 return ProtocolHandler(lower_protocol, url); 22 return ProtocolHandler(lower_protocol, url);
23 } 23 }
24 24
25 ProtocolHandler::ProtocolHandler() { 25 ProtocolHandler::ProtocolHandler() {
26 } 26 }
27 27
28 bool ProtocolHandler::IsValidDict(const base::DictionaryValue* value) { 28 bool ProtocolHandler::IsValidDict(const base::DictionaryValue* value) {
29 // Note that "title" parameter is ignored. 29 // Note that "title" parameter is ignored.
30 return value->HasKey("protocol") && value->HasKey("url"); 30 return value->HasKey("protocol") && value->HasKey("url");
31 } 31 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return protocol_ == other.protocol_ && url_ == other.url_; 77 return protocol_ == other.protocol_ && url_ == other.url_;
78 } 78 }
79 79
80 bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const { 80 bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const {
81 return protocol_ == other.protocol_ && url_ == other.url_; 81 return protocol_ == other.protocol_ && url_ == other.url_;
82 } 82 }
83 83
84 bool ProtocolHandler::operator<(const ProtocolHandler& other) const { 84 bool ProtocolHandler::operator<(const ProtocolHandler& other) const {
85 return url_ < other.url_; 85 return url_ < other.url_;
86 } 86 }
OLDNEW
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698