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

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

Issue 23455047: InstantExtended: Send search URLs to renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle TemplateURL change Created 7 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/search_urls.h"
6
7 #include "content/public/common/url_constants.h"
8 #include "url/gurl.h"
9
10 namespace search {
samarth 2013/09/20 16:43:40 I think we should consider moving all of the utili
Jered 2013/09/20 20:55:49 I agree. I don't think the grab bag of functions e
11
12 namespace {
13 bool MatchesOrigin(const GURL& my_url, const GURL& other_url) {
14 return my_url.host() == other_url.host() &&
15 my_url.port() == other_url.port() &&
16 (my_url.scheme() == other_url.scheme() ||
17 (my_url.SchemeIs(content::kHttpsScheme) &&
18 other_url.SchemeIs(content::kHttpScheme)));
19 }
20 } // namespace
21
22 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) {
samarth 2013/09/20 16:43:40 Unit test please.
Jered 2013/09/20 20:55:49 Done.
23 return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path();
24 }
25
26 } // namespace search
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698