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

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

Issue 8258004: Tweak omnibox parsing heuristics more: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_AUTOCOMPLETE_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Code that wants to format URLs with a format flag including 257 // Code that wants to format URLs with a format flag including
258 // net::kFormatUrlOmitTrailingSlashOnBareHostname risk changing the meaning if 258 // net::kFormatUrlOmitTrailingSlashOnBareHostname risk changing the meaning if
259 // the result is then parsed as AutocompleteInput. Such code can call this 259 // the result is then parsed as AutocompleteInput. Such code can call this
260 // function with the URL and its formatted string, and it will return a 260 // function with the URL and its formatted string, and it will return a
261 // formatted string with the same meaning as the original URL (i.e. it will 261 // formatted string with the same meaning as the original URL (i.e. it will
262 // re-append a slash if necessary). 262 // re-append a slash if necessary).
263 static string16 FormattedStringWithEquivalentMeaning( 263 static string16 FormattedStringWithEquivalentMeaning(
264 const GURL& url, 264 const GURL& url,
265 const string16& formatted_url); 265 const string16& formatted_url);
266 266
267 // Returns the number of non-empty components in |parts| besides the host.
268 static int NumNonHostComponents(const url_parse::Parsed& parts);
269
267 // User-provided text to be completed. 270 // User-provided text to be completed.
268 const string16& text() const { return text_; } 271 const string16& text() const { return text_; }
269 272
270 // Use of this setter is risky, since no other internal state is updated 273 // Use of this setter is risky, since no other internal state is updated
271 // besides |text_| and |parts_|. Only callers who know that they're not 274 // besides |text_| and |parts_|. Only callers who know that they're not
272 // changing the type/scheme/etc. should use this. 275 // changing the type/scheme/etc. should use this.
273 void UpdateText(const string16& text, const url_parse::Parsed& parts); 276 void UpdateText(const string16& text, const url_parse::Parsed& parts);
274 277
275 // User's desired TLD, if one is not already present in the text to 278 // User's desired TLD, if one is not already present in the text to
276 // autocomplete. When this is non-empty, it also implies that "www." should 279 // autocomplete. When this is non-empty, it also implies that "www." should
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 AutocompleteInput::Type input_type; 752 AutocompleteInput::Type input_type;
750 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). 753 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch).
751 size_t selected_index; 754 size_t selected_index;
752 // Inline autocompleted length (if displayed). 755 // Inline autocompleted length (if displayed).
753 size_t inline_autocompleted_length; 756 size_t inline_autocompleted_length;
754 // Result set. 757 // Result set.
755 const AutocompleteResult& result; 758 const AutocompleteResult& result;
756 }; 759 };
757 760
758 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ 761 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698