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

Side by Side Diff: chrome/common/search/search_urls.cc

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: rebase to #431874 Created 4 years, 1 month 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 "chrome/common/search/search_urls.h" 5 #include "chrome/common/search/search_urls.h"
6 6
7 #include "content/public/common/url_constants.h" 7 #include "content/public/common/url_constants.h"
8 #include "url/gurl.h" 8 #include "url/gurl.h"
9 9
10 namespace search { 10 namespace search {
11 11
12 namespace { 12 namespace {
13 bool MatchesOrigin(const GURL& my_url, const GURL& other_url) { 13 bool MatchesOrigin(const GURL& my_url, const GURL& other_url) {
14 return my_url.host() == other_url.host() && 14 return my_url.host_piece() == other_url.host_piece() &&
15 my_url.port() == other_url.port() && 15 my_url.port() == other_url.port() &&
16 (my_url.scheme() == other_url.scheme() || 16 (my_url.scheme_piece() == other_url.scheme_piece() ||
17 (my_url.SchemeIs(url::kHttpsScheme) && 17 (my_url.SchemeIs(url::kHttpsScheme) &&
18 other_url.SchemeIs(url::kHttpScheme))); 18 other_url.SchemeIs(url::kHttpScheme)));
19 } 19 }
20 } // namespace 20 } // namespace
21 21
22 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) { 22 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) {
23 return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path(); 23 return MatchesOrigin(my_url, other_url) &&
24 my_url.path_piece() == other_url.path_piece();
24 } 25 }
25 26
26 } // namespace search 27 } // namespace search
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698