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

Unified Diff: chrome/browser/autocomplete/history_contents_provider.cc

Issue 115885: Hoist TrimHttpPrefix() so we only have one copy, not one per provider.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/history_contents_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_contents_provider.cc (revision 17014)
+++ chrome/browser/autocomplete/history_contents_provider.cc (working copy)
@@ -9,6 +9,8 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/history/query_parser.h"
#include "chrome/browser/profile.h"
+#include "chrome/common/url_constants.h"
+#include "googleurl/src/url_util.h"
#include "net/base/net_util.h"
using base::TimeTicks;
@@ -72,6 +74,8 @@
// Change input type and reset relevance counters, so matches will be marked
// up properly.
input_type_ = input.type();
+ trim_http_ = !url_util::FindAndCompareScheme(WideToUTF8(input.text()),
+ chrome::kHttpScheme, NULL);
star_title_count_ = star_contents_count_ = title_count_ = contents_count_ = 0;
// Decide what to do about any previous query/results.
@@ -198,6 +202,8 @@
match.fill_into_edit = StringForURLDisplay(result.url(), true);
match.destination_url = result.url();
match.contents = match.fill_into_edit;
+ if (trim_http_)
+ TrimHttpPrefix(&match.contents);
match.contents_class.push_back(
ACMatchClassification(0, ACMatchClassification::URL));
match.description = result.title();
« no previous file with comments | « chrome/browser/autocomplete/history_contents_provider.h ('k') | chrome/browser/autocomplete/history_url_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698