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

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

Issue 2716273004: Invert description and URL for experimental zero suggest suggestions. (Closed)
Patch Set: Remove unnecessary function. Created 3 years, 9 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
« no previous file with comments | « no previous file | components/omnibox/browser/features.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_result.h" 5 #include "components/omnibox/browser/autocomplete_result.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const ACMatches& matches) { 87 const ACMatches& matches) {
88 for (const auto& i : matches) { 88 for (const auto& i : matches) {
89 #ifndef NDEBUG 89 #ifndef NDEBUG
90 DCHECK_EQ(AutocompleteMatch::SanitizeString(i.contents), i.contents); 90 DCHECK_EQ(AutocompleteMatch::SanitizeString(i.contents), i.contents);
91 DCHECK_EQ(AutocompleteMatch::SanitizeString(i.description), 91 DCHECK_EQ(AutocompleteMatch::SanitizeString(i.description),
92 i.description); 92 i.description);
93 #endif 93 #endif
94 matches_.push_back(i); 94 matches_.push_back(i);
95 if (!AutocompleteMatch::IsSearchType(i.type)) { 95 if (!AutocompleteMatch::IsSearchType(i.type)) {
96 const OmniboxFieldTrial::EmphasizeTitlesCondition condition( 96 const OmniboxFieldTrial::EmphasizeTitlesCondition condition(
97 OmniboxFieldTrial::GetEmphasizeTitlesConditionForInput(input.type())); 97 OmniboxFieldTrial::GetEmphasizeTitlesConditionForInput(input));
98 bool emphasize = false; 98 bool emphasize = false;
99 switch (condition) { 99 switch (condition) {
100 case OmniboxFieldTrial::EMPHASIZE_WHEN_NONEMPTY: 100 case OmniboxFieldTrial::EMPHASIZE_WHEN_NONEMPTY:
101 emphasize = !i.description.empty(); 101 emphasize = !i.description.empty();
102 break; 102 break;
103 case OmniboxFieldTrial::EMPHASIZE_WHEN_TITLE_MATCHES: 103 case OmniboxFieldTrial::EMPHASIZE_WHEN_TITLE_MATCHES:
104 emphasize = !i.description.empty() && 104 emphasize = !i.description.empty() &&
105 AutocompleteMatch::HasMatchStyle(i.description_class); 105 AutocompleteMatch::HasMatchStyle(i.description_class);
106 break; 106 break;
107 case OmniboxFieldTrial::EMPHASIZE_WHEN_ONLY_TITLE_MATCHES: 107 case OmniboxFieldTrial::EMPHASIZE_WHEN_ONLY_TITLE_MATCHES:
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 i != old_matches.rend() && delta > 0; ++i) { 398 i != old_matches.rend() && delta > 0; ++i) {
399 if (!HasMatchByDestination(*i, new_matches)) { 399 if (!HasMatchByDestination(*i, new_matches)) {
400 AutocompleteMatch match = *i; 400 AutocompleteMatch match = *i;
401 match.relevance = std::min(max_relevance, match.relevance); 401 match.relevance = std::min(max_relevance, match.relevance);
402 match.from_previous = true; 402 match.from_previous = true;
403 matches_.push_back(match); 403 matches_.push_back(match);
404 delta--; 404 delta--;
405 } 405 }
406 } 406 }
407 } 407 }
OLDNEW
« no previous file with comments | « no previous file | components/omnibox/browser/features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698