Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / autocomplete / history_provider_util.cc
blob439248d6da234f68f3c75a9ee7a04b14f0f2cf93
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"
9 namespace history {
11 HistoryMatch::HistoryMatch()
12 : url_info(),
13 input_location(base::string16::npos),
14 match_in_scheme(false),
15 innermost_match(true),
16 promoted(false) {
19 HistoryMatch::HistoryMatch(const URLRow& url_info,
20 size_t input_location,
21 bool match_in_scheme,
22 bool innermost_match)
23 : url_info(url_info),
24 input_location(input_location),
25 match_in_scheme(match_in_scheme),
26 innermost_match(innermost_match),
27 promoted(false) {
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() &&
38 !gurl.has_ref();
41 } // namespace history