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

Unified Diff: components/omnibox/autocomplete_result.cc

Issue 1206673002: Omnibox: Bug Fixes for Reverse Title (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HasMatch -> HasMatchStyle 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/omnibox/autocomplete_match.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/autocomplete_result.cc
diff --git a/components/omnibox/autocomplete_result.cc b/components/omnibox/autocomplete_result.cc
index a7299462e9806933f4b742e5c32115f2105829af..0dc95ab17230975686fbe91b7ead6849fc8a2287 100644
--- a/components/omnibox/autocomplete_result.cc
+++ b/components/omnibox/autocomplete_result.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <iterator>
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "components/metrics/proto/omnibox_event.pb.h"
@@ -15,6 +16,7 @@
#include "components/omnibox/autocomplete_match.h"
#include "components/omnibox/autocomplete_provider.h"
#include "components/omnibox/omnibox_field_trial.h"
+#include "components/omnibox/omnibox_switches.h"
#include "components/search/search.h"
#include "components/url_fixer/url_fixer.h"
@@ -170,7 +172,14 @@ void AutocompleteResult::AppendMatches(const AutocompleteInput& input,
i.description);
#endif
matches_.push_back(i);
- matches_.back().PossiblySwapContentsAndDescriptionForURLSuggestion(input);
+ if (!AutocompleteMatch::IsSearchType(i.type) && !i.description.empty() &&
+ base::CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kEmphasizeTitlesInOmniboxDropdown) &&
+ ((input.type() == metrics::OmniboxInputType::QUERY) ||
+ (input.type() == metrics::OmniboxInputType::FORCED_QUERY)) &&
+ AutocompleteMatch::HasMatchStyle(i.description_class)) {
+ matches_.back().swap_contents_and_description = true;
+ }
}
default_match_ = end();
alternate_nav_url_ = GURL();
« no previous file with comments | « components/omnibox/autocomplete_match.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698