| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 9 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 10 | 10 |
| 11 class AutocompleteInput; | 11 class AutocompleteInput; |
| 12 struct AutocompleteMatch; | 12 struct AutocompleteMatch; |
| 13 | 13 |
| 14 // This class is a base class for the history autocomplete providers and | 14 // This class is a base class for the history autocomplete providers and |
| 15 // provides functions useful to all derived classes. | 15 // provides functions useful to all derived classes. |
| 16 class HistoryProvider : public AutocompleteProvider { | 16 class HistoryProvider : public AutocompleteProvider { |
| 17 public: | 17 public: |
| 18 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | 18 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; |
| 19 | 19 |
| 20 protected: | 20 protected: |
| 21 HistoryProvider(AutocompleteProviderListener* listener, | 21 HistoryProvider(AutocompleteProviderListener* listener, |
| 22 Profile* profile, | 22 Profile* profile, |
| 23 const char* name); | 23 AutocompleteProvider::Type type); |
| 24 virtual ~HistoryProvider(); | 24 virtual ~HistoryProvider(); |
| 25 | 25 |
| 26 // Fixes up user URL input to make it more possible to match against. Among | 26 // Fixes up user URL input to make it more possible to match against. Among |
| 27 // many other things, this takes care of the following: | 27 // many other things, this takes care of the following: |
| 28 // * Prepending file:// to file URLs | 28 // * Prepending file:// to file URLs |
| 29 // * Converting drive letters in file URLs to uppercase | 29 // * Converting drive letters in file URLs to uppercase |
| 30 // * Converting case-insensitive parts of URLs (like the scheme and domain) | 30 // * Converting case-insensitive parts of URLs (like the scheme and domain) |
| 31 // to lowercase | 31 // to lowercase |
| 32 // * Convert spaces to %20s | 32 // * Convert spaces to %20s |
| 33 // Note that we don't do this in AutocompleteInput's constructor, because if | 33 // Note that we don't do this in AutocompleteInput's constructor, because if |
| (...skipping 14 matching lines...) Expand all Loading... |
| 48 // FixupUserInput(). This method returns true if | 48 // FixupUserInput(). This method returns true if |
| 49 // |input.prevent_inline_autocomplete()| is true, or the input text contains | 49 // |input.prevent_inline_autocomplete()| is true, or the input text contains |
| 50 // trailing whitespace, or if always_prevent_inline_autocomplete is true. | 50 // trailing whitespace, or if always_prevent_inline_autocomplete is true. |
| 51 bool PreventInlineAutocomplete(const AutocompleteInput& input); | 51 bool PreventInlineAutocomplete(const AutocompleteInput& input); |
| 52 | 52 |
| 53 // If true, we always prevent inline autocompletions. | 53 // If true, we always prevent inline autocompletions. |
| 54 bool always_prevent_inline_autocomplete_; | 54 bool always_prevent_inline_autocomplete_; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ | 57 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ |
| OLD | NEW |