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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_classifier.cc

Issue 10909130: autocomplete: Add AutocompleteProvider::Type enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add !! for windows Created 8 years, 3 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) 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 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 5 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "chrome/browser/autocomplete/autocomplete_controller.h" 8 #include "chrome/browser/autocomplete/autocomplete_controller.h"
9 #include "chrome/browser/autocomplete/autocomplete_input.h" 9 #include "chrome/browser/autocomplete/autocomplete_input.h"
10 #include "chrome/browser/autocomplete/autocomplete_match.h" 10 #include "chrome/browser/autocomplete/autocomplete_match.h"
11 #include "chrome/browser/autocomplete/autocomplete_provider.h"
11 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
12 13
14 // static
15 const int AutocompleteClassifier::kDefaultOmniboxProviders =
16 AutocompleteProvider::TYPE_BUILTIN |
17 AutocompleteProvider::TYPE_EXTENSION_APP |
18 AutocompleteProvider::TYPE_HISTORY_CONTENTS |
19 AutocompleteProvider::TYPE_HISTORY_QUICK |
20 AutocompleteProvider::TYPE_HISTORY_URL |
21 AutocompleteProvider::TYPE_KEYWORD |
22 AutocompleteProvider::TYPE_SEARCH |
23 AutocompleteProvider::TYPE_SHORTCUTS |
24 AutocompleteProvider::TYPE_ZERO_SUGGEST;
25
13 AutocompleteClassifier::AutocompleteClassifier(Profile* profile) 26 AutocompleteClassifier::AutocompleteClassifier(Profile* profile)
14 : controller_(new AutocompleteController(profile, NULL)), 27 : controller_(new AutocompleteController(profile, NULL,
28 kDefaultOmniboxProviders)),
15 inside_classify_(false) { 29 inside_classify_(false) {
16 } 30 }
17 31
18 AutocompleteClassifier::~AutocompleteClassifier() { 32 AutocompleteClassifier::~AutocompleteClassifier() {
19 // We should only reach here after Shutdown() has been called. 33 // We should only reach here after Shutdown() has been called.
20 DCHECK(!controller_.get()); 34 DCHECK(!controller_.get());
21 } 35 }
22 36
23 void AutocompleteClassifier::Classify(const string16& text, 37 void AutocompleteClassifier::Classify(const string16& text,
24 const string16& desired_tld, 38 const string16& desired_tld,
(...skipping 15 matching lines...) Expand all
40 54
41 DCHECK(result.default_match() != result.end()); 55 DCHECK(result.default_match() != result.end());
42 *match = *result.default_match(); 56 *match = *result.default_match();
43 if (alternate_nav_url) 57 if (alternate_nav_url)
44 *alternate_nav_url = result.alternate_nav_url(); 58 *alternate_nav_url = result.alternate_nav_url();
45 } 59 }
46 60
47 void AutocompleteClassifier::Shutdown() { 61 void AutocompleteClassifier::Shutdown() {
48 controller_.reset(); 62 controller_.reset();
49 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_classifier.h ('k') | chrome/browser/autocomplete/autocomplete_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698