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

Side by Side Diff: components/history/core/browser/url_utils.cc

Issue 1279123004: Replace ToLower calls to the new format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/history/core/browser/url_utils.h" 5 #include "components/history/core/browser/url_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return GURL::EmptyGURL(); 81 return GURL::EmptyGURL();
82 url::Component comp; 82 url::Component comp;
83 comp.len = static_cast<int>(new_scheme.length()); 83 comp.len = static_cast<int>(new_scheme.length());
84 GURL::Replacements replacement; 84 GURL::Replacements replacement;
85 replacement.SetScheme(new_scheme.c_str(), comp); 85 replacement.SetScheme(new_scheme.c_str(), comp);
86 return url.ReplaceComponents(replacement); 86 return url.ReplaceComponents(replacement);
87 } 87 }
88 88
89 std::string HostForTopHosts(const GURL& url) { 89 std::string HostForTopHosts(const GURL& url) {
90 std::string host = url.host(); 90 std::string host = url.host();
91 base::StringToLowerASCII(&host);
92 if (base::StartsWith(host, "www.", base::CompareCase::SENSITIVE)) 91 if (base::StartsWith(host, "www.", base::CompareCase::SENSITIVE))
93 host.assign(host, 4, std::string::npos); 92 host.assign(host, 4, std::string::npos);
94 return host; 93 return host;
95 } 94 }
96 95
97 } // namespace history 96 } // namespace history
OLDNEW
« no previous file with comments | « components/device_event_log/device_event_log_impl.cc ('k') | components/language_usage_metrics/language_usage_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698