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

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

Issue 1185723002: Prepare HistoryProvider for componentization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 years, 6 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 "chrome/browser/autocomplete/history_url_provider.h" 5 #include "chrome/browser/autocomplete/history_url_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 promote_type(NEITHER), 464 promote_type(NEITHER),
465 languages(languages), 465 languages(languages),
466 default_search_provider(default_search_provider ? 466 default_search_provider(default_search_provider ?
467 new TemplateURL(default_search_provider->data()) : NULL), 467 new TemplateURL(default_search_provider->data()) : NULL),
468 search_terms_data(new SearchTermsDataSnapshot(search_terms_data)) { 468 search_terms_data(new SearchTermsDataSnapshot(search_terms_data)) {
469 } 469 }
470 470
471 HistoryURLProviderParams::~HistoryURLProviderParams() { 471 HistoryURLProviderParams::~HistoryURLProviderParams() {
472 } 472 }
473 473
474 HistoryURLProvider::HistoryURLProvider(AutocompleteProviderListener* listener, 474 HistoryURLProvider::HistoryURLProvider(
475 Profile* profile) 475 scoped_ptr<AutocompleteProviderClient> client,
476 : HistoryProvider(profile, AutocompleteProvider::TYPE_HISTORY_URL), 476 AutocompleteProviderListener* listener,
477 Profile* profile)
478 : HistoryProvider(client.Pass(), AutocompleteProvider::TYPE_HISTORY_URL),
479 profile_(profile),
477 listener_(listener), 480 listener_(listener),
478 params_(NULL) { 481 params_(NULL) {
479 // Initialize HUP scoring params based on the current experiment. 482 // Initialize HUP scoring params based on the current experiment.
480 OmniboxFieldTrial::GetExperimentalHUPScoringParams(&scoring_params_); 483 OmniboxFieldTrial::GetExperimentalHUPScoringParams(&scoring_params_);
481 } 484 }
482 485
483 void HistoryURLProvider::Start(const AutocompleteInput& input, 486 void HistoryURLProvider::Start(const AutocompleteInput& input,
484 bool minimal_changes, 487 bool minimal_changes,
485 bool called_due_to_focus) { 488 bool called_due_to_focus) {
486 // NOTE: We could try hard to do less work in the |minimal_changes| case 489 // NOTE: We could try hard to do less work in the |minimal_changes| case
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, 1182 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0,
1180 match.contents.length(), ACMatchClassification::URL, 1183 match.contents.length(), ACMatchClassification::URL,
1181 &match.contents_class); 1184 &match.contents_class);
1182 } 1185 }
1183 match.description = info.title(); 1186 match.description = info.title();
1184 match.description_class = 1187 match.description_class =
1185 ClassifyDescription(params.input.text(), match.description); 1188 ClassifyDescription(params.input.text(), match.description);
1186 RecordAdditionalInfoFromUrlRow(info, &match); 1189 RecordAdditionalInfoFromUrlRow(info, &match);
1187 return match; 1190 return match;
1188 } 1191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698