Chromium Code Reviews| 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 COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CLASSIFIER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CLASSIFIER_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CLASSIFIER_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CLASSIFIER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
| 14 #include "components/metrics/proto/omnibox_event.pb.h" | 14 #include "components/metrics/proto/omnibox_event.pb.h" |
| 15 #include "components/omnibox/browser/autocomplete_scheme_classifier.h" | 15 #include "components/omnibox/browser/autocomplete_scheme_classifier.h" |
| 16 | 16 |
| 17 class AutocompleteController; | 17 class AutocompleteController; |
| 18 struct AutocompleteMatch; | 18 struct AutocompleteMatch; |
| 19 class GURL; | 19 class GURL; |
| 20 | 20 |
| 21 class AutocompleteClassifier : public KeyedService { | 21 class AutocompleteClassifier : public KeyedService { |
| 22 public: | 22 public: |
| 23 // Bitmap of AutocompleteProvider::Type values describing the default set of | 23 // Bitmap of AutocompleteProvider::Type values describing the default set of |
| 24 // providers queried for the omnibox. Intended to be passed to | 24 // providers queried for the omnibox. Intended to be passed to |
| 25 // AutocompleteController(). | 25 // AutocompleteController(). |
| 26 static const int kDefaultOmniboxProviders; | 26 static int DefaultOmniboxProviders(); |
|
Mark P
2017/02/28 23:06:02
TODO(mpearson): after review, move this down to li
| |
| 27 | 27 |
| 28 AutocompleteClassifier( | 28 AutocompleteClassifier( |
| 29 std::unique_ptr<AutocompleteController> controller_, | 29 std::unique_ptr<AutocompleteController> controller_, |
| 30 std::unique_ptr<AutocompleteSchemeClassifier> scheme_classifier); | 30 std::unique_ptr<AutocompleteSchemeClassifier> scheme_classifier); |
| 31 ~AutocompleteClassifier() override; | 31 ~AutocompleteClassifier() override; |
| 32 | 32 |
| 33 // KeyedService: | 33 // KeyedService: |
| 34 void Shutdown() override; | 34 void Shutdown() override; |
| 35 | 35 |
| 36 // Given some string |text| that the user wants to use for navigation, | 36 // Given some string |text| that the user wants to use for navigation, |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 62 std::unique_ptr<AutocompleteSchemeClassifier> scheme_classifier_; | 62 std::unique_ptr<AutocompleteSchemeClassifier> scheme_classifier_; |
| 63 | 63 |
| 64 // Are we currently in Classify? Used to verify Classify isn't invoked | 64 // Are we currently in Classify? Used to verify Classify isn't invoked |
| 65 // recursively, since this can corrupt state and cause crashes. | 65 // recursively, since this can corrupt state and cause crashes. |
| 66 bool inside_classify_; | 66 bool inside_classify_; |
| 67 | 67 |
| 68 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteClassifier); | 68 DISALLOW_IMPLICIT_CONSTRUCTORS(AutocompleteClassifier); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CLASSIFIER_H_ | 71 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CLASSIFIER_H_ |
| OLD | NEW |