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

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

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Fix comments and add title in verbatim_match.cc Created 3 years, 8 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/history_url_provider.h" 5 #include "components/omnibox/browser/history_url_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 match.contents, 609 match.contents,
610 ACMatchClassification::URL, 610 ACMatchClassification::URL,
611 &match.contents_class); 611 &match.contents_class);
612 } else { 612 } else {
613 AutocompleteMatch::ClassifyLocationInString( 613 AutocompleteMatch::ClassifyLocationInString(
614 best_prefix->prefix.length() - offset, input.text().length(), 614 best_prefix->prefix.length() - offset, input.text().length(),
615 match.contents.length(), ACMatchClassification::URL, 615 match.contents.length(), ACMatchClassification::URL,
616 &match.contents_class); 616 &match.contents_class);
617 } 617 }
618 } 618 }
619
620 return match; 619 return match;
Mark P 2017/04/12 17:58:46 nit: might as well keep the blank line here (parti
gcomanici 2017/04/12 19:25:00 Done.
621 } 620 }
622 621
623 void HistoryURLProvider::ExecuteWithDB(HistoryURLProviderParams* params, 622 void HistoryURLProvider::ExecuteWithDB(HistoryURLProviderParams* params,
624 history::HistoryBackend* backend, 623 history::HistoryBackend* backend,
625 history::URLDatabase* db) { 624 history::URLDatabase* db) {
626 // We may get called with a null database if it couldn't be properly 625 // We may get called with a null database if it couldn't be properly
627 // initialized. 626 // initialized.
628 if (!db) { 627 if (!db) {
629 params->failed = true; 628 params->failed = true;
630 } else if (!params->cancel_flag.IsSet()) { 629 } else if (!params->cancel_flag.IsSet()) {
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, 1186 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0,
1188 match.contents.length(), ACMatchClassification::URL, 1187 match.contents.length(), ACMatchClassification::URL,
1189 &match.contents_class); 1188 &match.contents_class);
1190 } 1189 }
1191 match.description = info.title(); 1190 match.description = info.title();
1192 match.description_class = 1191 match.description_class =
1193 ClassifyDescription(params.input.text(), match.description); 1192 ClassifyDescription(params.input.text(), match.description);
1194 RecordAdditionalInfoFromUrlRow(info, &match); 1193 RecordAdditionalInfoFromUrlRow(info, &match);
1195 return match; 1194 return match;
1196 } 1195 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698