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