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 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace history { | 9 namespace history { |
10 | 10 |
11 HistoryMatch::HistoryMatch() | 11 HistoryMatch::HistoryMatch() |
12 : url_info(), | 12 : url_info(), |
13 input_location(string16::npos), | 13 input_location(base::string16::npos), |
14 match_in_scheme(false), | 14 match_in_scheme(false), |
15 innermost_match(true), | 15 innermost_match(true), |
16 promoted(false) { | 16 promoted(false) { |
17 } | 17 } |
18 | 18 |
19 HistoryMatch::HistoryMatch(const URLRow& url_info, | 19 HistoryMatch::HistoryMatch(const URLRow& url_info, |
20 size_t input_location, | 20 size_t input_location, |
21 bool match_in_scheme, | 21 bool match_in_scheme, |
22 bool innermost_match) | 22 bool innermost_match) |
23 : url_info(url_info), | 23 : url_info(url_info), |
24 input_location(input_location), | 24 input_location(input_location), |
25 match_in_scheme(match_in_scheme), | 25 match_in_scheme(match_in_scheme), |
26 innermost_match(innermost_match), | 26 innermost_match(innermost_match), |
27 promoted(false) { | 27 promoted(false) { |
28 } | 28 } |
29 | 29 |
30 bool HistoryMatch::EqualsGURL(const HistoryMatch& h, const GURL& url) { | 30 bool HistoryMatch::EqualsGURL(const HistoryMatch& h, const GURL& url) { |
31 return h.url_info.url() == url; | 31 return h.url_info.url() == url; |
32 } | 32 } |
33 | 33 |
34 bool HistoryMatch::IsHostOnly() const { | 34 bool HistoryMatch::IsHostOnly() const { |
35 const GURL& gurl = url_info.url(); | 35 const GURL& gurl = url_info.url(); |
36 DCHECK(gurl.is_valid()); | 36 DCHECK(gurl.is_valid()); |
37 return (!gurl.has_path() || (gurl.path() == "/")) && !gurl.has_query() && | 37 return (!gurl.has_path() || (gurl.path() == "/")) && !gurl.has_query() && |
38 !gurl.has_ref(); | 38 !gurl.has_ref(); |
39 } | 39 } |
40 | 40 |
41 } // namespace history | 41 } // namespace history |
OLD | NEW |