Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/autocomplete/history_url_provider.cc

Issue 151168: Moved typedef of RedirectList from HistoryService class to history namespace.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_url_provider.h" 5 #include "chrome/browser/autocomplete/history_url_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 } 740 }
741 } 741 }
742 742
743 void HistoryURLProvider::CullRedirects(history::HistoryBackend* backend, 743 void HistoryURLProvider::CullRedirects(history::HistoryBackend* backend,
744 HistoryMatches* matches, 744 HistoryMatches* matches,
745 size_t max_results) const { 745 size_t max_results) const {
746 for (size_t source = 0; 746 for (size_t source = 0;
747 (source < matches->size()) && (source < max_results); ) { 747 (source < matches->size()) && (source < max_results); ) {
748 const GURL& url = (*matches)[source].url_info.url(); 748 const GURL& url = (*matches)[source].url_info.url();
749 // TODO(brettw) this should go away when everything uses GURL. 749 // TODO(brettw) this should go away when everything uses GURL.
750 HistoryService::RedirectList redirects; 750 history::RedirectList redirects;
751 backend->GetMostRecentRedirectsFrom(url, &redirects); 751 backend->GetMostRecentRedirectsFrom(url, &redirects);
752 if (!redirects.empty()) { 752 if (!redirects.empty()) {
753 // Remove all but the first occurrence of any of these redirects in the 753 // Remove all but the first occurrence of any of these redirects in the
754 // search results. We also must add the URL we queried for, since it may 754 // search results. We also must add the URL we queried for, since it may
755 // not be the first match and we'd want to remove it. 755 // not be the first match and we'd want to remove it.
756 // 756 //
757 // For example, when A redirects to B and our matches are [A, X, B], 757 // For example, when A redirects to B and our matches are [A, X, B],
758 // we'll get B as the redirects from, and we want to remove the second 758 // we'll get B as the redirects from, and we want to remove the second
759 // item of that pair, removing B. If A redirects to B and our matches are 759 // item of that pair, removing B. If A redirects to B and our matches are
760 // [B, X, A], we'll want to remove A instead. 760 // [B, X, A], we'll want to remove A instead.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 history_match.input_location - offset, params->input.text().length(), 832 history_match.input_location - offset, params->input.text().length(),
833 match.contents.length(), ACMatchClassification::URL, 833 match.contents.length(), ACMatchClassification::URL,
834 &match.contents_class); 834 &match.contents_class);
835 match.description = info.title(); 835 match.description = info.title();
836 AutocompleteMatch::ClassifyMatchInString(params->input.text(), info.title(), 836 AutocompleteMatch::ClassifyMatchInString(params->input.text(), info.title(),
837 ACMatchClassification::NONE, 837 ACMatchClassification::NONE,
838 &match.description_class); 838 &match.description_class);
839 839
840 return match; 840 return match;
841 } 841 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698