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

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

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 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 #include <deque> 10 #include <deque>
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // * Prepending file:// to file URLs 248 // * Prepending file:// to file URLs
249 // * Converting drive letters in file URLs to uppercase 249 // * Converting drive letters in file URLs to uppercase
250 // * Converting case-insensitive parts of URLs (like the scheme and domain) 250 // * Converting case-insensitive parts of URLs (like the scheme and domain)
251 // to lowercase 251 // to lowercase
252 // * Convert spaces to %20s 252 // * Convert spaces to %20s
253 // Note that we don't do this in AutocompleteInput's constructor, because if 253 // Note that we don't do this in AutocompleteInput's constructor, because if
254 // e.g. we convert a Unicode hostname to punycode, other providers will show 254 // e.g. we convert a Unicode hostname to punycode, other providers will show
255 // output that surprises the user ("Search Google for xn--6ca.com"). 255 // output that surprises the user ("Search Google for xn--6ca.com").
256 static std::wstring FixupUserInput(const AutocompleteInput& input); 256 static std::wstring FixupUserInput(const AutocompleteInput& input);
257 257
258 // Trims "http:" and up to two subsequent slashes from |url|. Returns the
259 // number of characters that were trimmed.
260 static size_t TrimHttpPrefix(std::wstring* url);
261
262 // Returns true if |url| is just a host (e.g. "http://www.google.com/") and 258 // Returns true if |url| is just a host (e.g. "http://www.google.com/") and
263 // not some other subpage (e.g. "http://www.google.com/foo.html"). 259 // not some other subpage (e.g. "http://www.google.com/foo.html").
264 static bool IsHostOnly(const GURL& url); 260 static bool IsHostOnly(const GURL& url);
265 261
266 // Acts like the > operator for URLInfo classes. 262 // Acts like the > operator for URLInfo classes.
267 static bool CompareHistoryMatch(const HistoryMatch& a, 263 static bool CompareHistoryMatch(const HistoryMatch& a,
268 const HistoryMatch& b); 264 const HistoryMatch& b);
269 265
270 // Returns the set of prefixes to use for prefixes_. 266 // Returns the set of prefixes to use for prefixes_.
271 static Prefixes GetPrefixes(); 267 static Prefixes GetPrefixes();
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 const Prefixes prefixes_; 381 const Prefixes prefixes_;
386 382
387 // Params for the current query. The provider should not free this directly; 383 // Params for the current query. The provider should not free this directly;
388 // instead, it is passed as a parameter through the history backend, and the 384 // instead, it is passed as a parameter through the history backend, and the
389 // parameter itself is freed once it's no longer needed. The only reason we 385 // parameter itself is freed once it's no longer needed. The only reason we
390 // keep this member is so we can set the cancel bit on it. 386 // keep this member is so we can set the cancel bit on it.
391 HistoryURLProviderParams* params_; 387 HistoryURLProviderParams* params_;
392 }; 388 };
393 389
394 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ 390 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_contents_provider.cc ('k') | chrome/browser/autocomplete/history_url_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698