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

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

Issue 16019014: Remove "Search" suffix from omnibox search engine match (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restrict removal to extension keywords Created 7 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autocomplete_controller.h" 5 #include "chrome/browser/autocomplete/autocomplete_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 if ((i->provider->type() == AutocompleteProvider::TYPE_KEYWORD && 554 if ((i->provider->type() == AutocompleteProvider::TYPE_KEYWORD &&
555 !i->keyword.empty()) || 555 !i->keyword.empty()) ||
556 (i->provider->type() == AutocompleteProvider::TYPE_SEARCH && 556 (i->provider->type() == AutocompleteProvider::TYPE_SEARCH &&
557 AutocompleteMatch::IsSearchType(i->type))) { 557 AutocompleteMatch::IsSearchType(i->type))) {
558 i->description.clear(); 558 i->description.clear();
559 i->description_class.clear(); 559 i->description_class.clear();
560 DCHECK(!i->keyword.empty()); 560 DCHECK(!i->keyword.empty());
561 if (i->keyword != last_keyword) { 561 if (i->keyword != last_keyword) {
562 const TemplateURL* template_url = i->GetTemplateURL(profile_, false); 562 const TemplateURL* template_url = i->GetTemplateURL(profile_, false);
563 if (template_url) { 563 if (template_url) {
564 i->description = l10n_util::GetStringFUTF16( 564 // Don't add the "Search" suffix for extension keywords.
Peter Kasting 2013/05/29 21:07:20 Nit: Shorter but with a more descriptive comment:
Aaron Jacobs 2013/05/29 21:27:21 Done.
565 IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION, 565 if (template_url->IsExtensionKeyword()) {
566 template_url->AdjustedShortNameForLocaleDirection()); 566 i->description =
567 template_url->AdjustedShortNameForLocaleDirection();
568 } else {
569 i->description = l10n_util::GetStringFUTF16(
570 IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION,
571 template_url->AdjustedShortNameForLocaleDirection());
572 }
567 i->description_class.push_back( 573 i->description_class.push_back(
568 ACMatchClassification(0, ACMatchClassification::DIM)); 574 ACMatchClassification(0, ACMatchClassification::DIM));
569 } 575 }
570 last_keyword = i->keyword; 576 last_keyword = i->keyword;
571 } 577 }
572 } else { 578 } else {
573 last_keyword.clear(); 579 last_keyword.clear();
574 } 580 }
575 } 581 }
576 } 582 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 // it to the edit model / dropdown display code. 634 // it to the edit model / dropdown display code.
629 if (!chrome::IsInstantExtendedAPIEnabled() && 635 if (!chrome::IsInstantExtendedAPIEnabled() &&
630 !chrome::IsInstantEnabled(profile_)) { 636 !chrome::IsInstantEnabled(profile_)) {
631 stop_timer_.Start(FROM_HERE, 637 stop_timer_.Start(FROM_HERE,
632 base::TimeDelta::FromMilliseconds(kStopTimeMS), 638 base::TimeDelta::FromMilliseconds(kStopTimeMS),
633 base::Bind(&AutocompleteController::Stop, 639 base::Bind(&AutocompleteController::Stop,
634 base::Unretained(this), 640 base::Unretained(this),
635 false)); 641 false));
636 } 642 }
637 } 643 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698