OLD | NEW |
---|---|
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/browser/autocomplete/history_provider_util.h" | 5 #include "chrome/browser/autocomplete/history_provider_util.h" |
6 #include "base/logging.h" | |
Peter Kasting
2012/08/25 04:38:57
Nit: Alphabetical
Mark P
2012/08/26 01:23:05
I thought the associated .h file always came first
| |
6 | 7 |
7 namespace history { | 8 namespace history { |
8 | 9 |
9 HistoryMatch::HistoryMatch() | 10 HistoryMatch::HistoryMatch() |
10 : url_info(), | 11 : url_info(), |
11 input_location(string16::npos), | 12 input_location(string16::npos), |
12 match_in_scheme(false), | 13 match_in_scheme(false), |
13 innermost_match(true) { | 14 innermost_match(true) { |
14 } | 15 } |
15 | 16 |
16 HistoryMatch::HistoryMatch(const URLRow& url_info, | 17 HistoryMatch::HistoryMatch(const URLRow& url_info, |
17 size_t input_location, | 18 size_t input_location, |
18 bool match_in_scheme, | 19 bool match_in_scheme, |
19 bool innermost_match) | 20 bool innermost_match) |
20 : url_info(url_info), | 21 : url_info(url_info), |
21 input_location(input_location), | 22 input_location(input_location), |
22 match_in_scheme(match_in_scheme), | 23 match_in_scheme(match_in_scheme), |
23 innermost_match(innermost_match) { | 24 innermost_match(innermost_match) { |
24 } | 25 } |
25 | 26 |
26 bool HistoryMatch::EqualsGURL(const HistoryMatch& h, const GURL& url) { | 27 bool HistoryMatch::EqualsGURL(const HistoryMatch& h, const GURL& url) { |
27 return h.url_info.url() == url; | 28 return h.url_info.url() == url; |
28 } | 29 } |
29 | 30 |
31 bool HistoryMatch::IsHostOnly() const { | |
32 const GURL& gurl = url_info.url(); | |
33 DCHECK(gurl.is_valid()); | |
34 return (!gurl.has_path() || (gurl.path() == "/")) && !gurl.has_query() && | |
35 !gurl.has_ref(); | |
36 } | |
37 | |
30 } // namespace history | 38 } // namespace history |
OLD | NEW |