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
3 // found in the LICENSE file.
5 #include "chrome/browser/autocomplete/history_provider_util.h"
7 #include "base/logging.h"
11 HistoryMatch::HistoryMatch()
13 input_location(string16::npos),
14 match_in_scheme(false),
15 innermost_match(true),
19 HistoryMatch::HistoryMatch(const URLRow& url_info,
20 size_t input_location,
24 input_location(input_location),
25 match_in_scheme(match_in_scheme),
26 innermost_match(innermost_match),
30 bool HistoryMatch::EqualsGURL(const HistoryMatch& h, const GURL& url) {
31 return h.url_info.url() == url;
34 bool HistoryMatch::IsHostOnly() const {
35 const GURL& gurl = url_info.url();
36 DCHECK(gurl.is_valid());
37 return (!gurl.has_path() || (gurl.path() == "/")) && !gurl.has_query() &&
41 } // namespace history