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

Side by Side Diff: components/omnibox/browser/autocomplete_classifier.cc

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Remove debugging info. Created 3 years, 7 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
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 "components/omnibox/browser/autocomplete_classifier.h" 5 #include "components/omnibox/browser/autocomplete_classifier.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void AutocompleteClassifier::Classify( 61 void AutocompleteClassifier::Classify(
62 const base::string16& text, 62 const base::string16& text,
63 bool prefer_keyword, 63 bool prefer_keyword,
64 bool allow_exact_keyword_match, 64 bool allow_exact_keyword_match,
65 metrics::OmniboxEventProto::PageClassification page_classification, 65 metrics::OmniboxEventProto::PageClassification page_classification,
66 AutocompleteMatch* match, 66 AutocompleteMatch* match,
67 GURL* alternate_nav_url) { 67 GURL* alternate_nav_url) {
68 DCHECK(!inside_classify_); 68 DCHECK(!inside_classify_);
69 base::AutoReset<bool> reset(&inside_classify_, true); 69 base::AutoReset<bool> reset(&inside_classify_, true);
70 controller_->Start(AutocompleteInput( 70 controller_->Start(AutocompleteInput(
71 text, base::string16::npos, std::string(), GURL(), page_classification, 71 text, base::string16::npos, std::string(), GURL(), base::string16(),
72 true, prefer_keyword, allow_exact_keyword_match, false, false, 72 page_classification, true, prefer_keyword, allow_exact_keyword_match,
73 *scheme_classifier_)); 73 false, false, *scheme_classifier_));
74 DCHECK(controller_->done()); 74 DCHECK(controller_->done());
75 const AutocompleteResult& result = controller_->result(); 75 const AutocompleteResult& result = controller_->result();
76 if (result.empty()) { 76 if (result.empty()) {
77 if (alternate_nav_url) 77 if (alternate_nav_url)
78 *alternate_nav_url = GURL(); 78 *alternate_nav_url = GURL();
79 return; 79 return;
80 } 80 }
81 81
82 DCHECK(result.default_match() != result.end()); 82 DCHECK(result.default_match() != result.end());
83 *match = *result.default_match(); 83 *match = *result.default_match();
84 if (alternate_nav_url) 84 if (alternate_nav_url)
85 *alternate_nav_url = result.alternate_nav_url(); 85 *alternate_nav_url = result.alternate_nav_url();
86 } 86 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/startup_pages_handler.cc ('k') | components/omnibox/browser/autocomplete_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698