1 // Copyright 2014 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 "components/history/core/browser/history_match.h"
7 #include "base/logging.h"
11 HistoryMatch::HistoryMatch()
13 input_location(base::string16::npos),
14 match_in_scheme(false),
15 innermost_match(true) {
18 HistoryMatch::HistoryMatch(const URLRow& url_info,
19 size_t input_location,
23 input_location(input_location),
24 match_in_scheme(match_in_scheme),
25 innermost_match(innermost_match) {
28 bool HistoryMatch::EqualsGURL(const HistoryMatch& h, const GURL& url) {
29 return h.url_info.url() == url;
32 bool HistoryMatch::IsHostOnly() const {
33 const GURL& gurl = url_info.url();
34 DCHECK(gurl.is_valid());
35 return (!gurl.has_path() || (gurl.path() == "/")) && !gurl.has_query() &&
39 } // namespace history