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

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

Issue 2966233002: Omnibox UI Experiments: Strip trivial subdomains (Closed)
Patch Set: address one more comment Created 3 years, 5 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/autocomplete_match_unittest.cc » ('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_match.h" 5 #include "components/omnibox/browser/autocomplete_match.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 format_types &= ~url_formatter::kFormatUrlOmitHTTP; 495 format_types &= ~url_formatter::kFormatUrlOmitHTTP;
496 } else if (base::FeatureList::IsEnabled( 496 } else if (base::FeatureList::IsEnabled(
497 omnibox::kUIExperimentHideSuggestionUrlScheme)) { 497 omnibox::kUIExperimentHideSuggestionUrlScheme)) {
498 format_types |= url_formatter::kFormatUrlExperimentalOmitHTTPS; 498 format_types |= url_formatter::kFormatUrlExperimentalOmitHTTPS;
499 } 499 }
500 500
501 if (base::FeatureList::IsEnabled( 501 if (base::FeatureList::IsEnabled(
502 omnibox::kUIExperimentElideSuggestionUrlAfterHost)) { 502 omnibox::kUIExperimentElideSuggestionUrlAfterHost)) {
503 format_types |= url_formatter::kFormatUrlExperimentalElideAfterHost; 503 format_types |= url_formatter::kFormatUrlExperimentalElideAfterHost;
504 } 504 }
505
506 if (base::FeatureList::IsEnabled(
507 omnibox::kUIExperimentHideSuggestionUrlTrivialSubdomains)) {
508 format_types |= url_formatter::kFormatUrlExperimentalOmitTrivialSubdomains;
509 }
510
505 return format_types; 511 return format_types;
506 } 512 }
507 513
508 void AutocompleteMatch::ComputeStrippedDestinationURL( 514 void AutocompleteMatch::ComputeStrippedDestinationURL(
509 const AutocompleteInput& input, 515 const AutocompleteInput& input,
510 TemplateURLService* template_url_service) { 516 TemplateURLService* template_url_service) {
511 stripped_destination_url = GURLToStrippedGURL( 517 stripped_destination_url = GURLToStrippedGURL(
512 destination_url, input, template_url_service, keyword); 518 destination_url, input, template_url_service, keyword);
513 } 519 }
514 520
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 << " is unsorted in relation to last offset of " << last_offset 649 << " is unsorted in relation to last offset of " << last_offset
644 << ". Provider: " << provider_name << "."; 650 << ". Provider: " << provider_name << ".";
645 DCHECK_LT(i->offset, text.length()) 651 DCHECK_LT(i->offset, text.length())
646 << " Classification of [" << i->offset << "," << text.length() 652 << " Classification of [" << i->offset << "," << text.length()
647 << "] is out of bounds for \"" << text << "\". Provider: " 653 << "] is out of bounds for \"" << text << "\". Provider: "
648 << provider_name << "."; 654 << provider_name << ".";
649 last_offset = i->offset; 655 last_offset = i->offset;
650 } 656 }
651 } 657 }
652 #endif 658 #endif
OLDNEW
« no previous file with comments | « no previous file | components/omnibox/browser/autocomplete_match_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698