| 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_AUTOCOMPLETE_CLASSIFIER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 12 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 13 | 13 |
| 14 class AutocompleteController; | 14 class AutocompleteController; |
| 15 struct AutocompleteMatch; | 15 struct AutocompleteMatch; |
| 16 class GURL; | 16 class GURL; |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 class AutocompleteClassifier : public ProfileKeyedService { | 19 class AutocompleteClassifier : public BrowserContextKeyedService { |
| 20 public: | 20 public: |
| 21 // Bitmap of AutocompleteProvider::Type values describing the default set of | 21 // Bitmap of AutocompleteProvider::Type values describing the default set of |
| 22 // providers queried for the omnibox. Intended to be passed to | 22 // providers queried for the omnibox. Intended to be passed to |
| 23 // AutocompleteController(). | 23 // AutocompleteController(). |
| 24 static const int kDefaultOmniboxProviders; | 24 static const int kDefaultOmniboxProviders; |
| 25 | 25 |
| 26 // Bitmap of AutocompleteProvider::Type values describing the set of providers | 26 // Bitmap of AutocompleteProvider::Type values describing the set of providers |
| 27 // that have been whitelisted as working properly with the Instant Extended | 27 // that have been whitelisted as working properly with the Instant Extended |
| 28 // API. Intended to be passed to AutocompleteController(). | 28 // API. Intended to be passed to AutocompleteController(). |
| 29 static const int kInstantExtendedOmniboxProviders; | 29 static const int kInstantExtendedOmniboxProviders; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 // non-NULL, will be set to the navigational URL (if any) in case of an | 44 // non-NULL, will be set to the navigational URL (if any) in case of an |
| 45 // accidental search; see comments on | 45 // accidental search; see comments on |
| 46 // AutocompleteResult::alternate_nav_url_ in autocomplete.h. | 46 // AutocompleteResult::alternate_nav_url_ in autocomplete.h. |
| 47 void Classify(const string16& text, | 47 void Classify(const string16& text, |
| 48 bool prefer_keyword, | 48 bool prefer_keyword, |
| 49 bool allow_exact_keyword_match, | 49 bool allow_exact_keyword_match, |
| 50 AutocompleteMatch* match, | 50 AutocompleteMatch* match, |
| 51 GURL* alternate_nav_url); | 51 GURL* alternate_nav_url); |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // ProfileKeyedService: | 54 // BrowserContextKeyedService: |
| 55 virtual void Shutdown() OVERRIDE; | 55 virtual void Shutdown() OVERRIDE; |
| 56 | 56 |
| 57 scoped_ptr<AutocompleteController> controller_; | 57 scoped_ptr<AutocompleteController> controller_; |
| 58 | 58 |
| 59 // Are we currently in Classify? Used to verify Classify isn't invoked | 59 // Are we currently in Classify? Used to verify Classify isn't invoked |
| 60 // recursively, since this can corrupt state and cause crashes. | 60 // recursively, since this can corrupt state and cause crashes. |
| 61 bool inside_classify_; | 61 bool inside_classify_; |
| 62 | 62 |
| 63 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteClassifier); | 63 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteClassifier); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_H_ | 66 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_H_ |
| OLD | NEW |