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

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

Issue 2347973002: Enable Chrome to tweak search engines for some locales (Closed)
Patch Set: final nits Created 4 years, 2 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/autocomplete_controller.h" 5 #include "components/omnibox/browser/autocomplete_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 i->description_class.clear(); 546 i->description_class.clear();
547 DCHECK(!i->keyword.empty()); 547 DCHECK(!i->keyword.empty());
548 if (i->keyword != last_keyword) { 548 if (i->keyword != last_keyword) {
549 const TemplateURL* template_url = 549 const TemplateURL* template_url =
550 i->GetTemplateURL(template_url_service_, false); 550 i->GetTemplateURL(template_url_service_, false);
551 if (template_url) { 551 if (template_url) {
552 // For extension keywords, just make the description the extension 552 // For extension keywords, just make the description the extension
553 // name -- don't assume that the normal search keyword description is 553 // name -- don't assume that the normal search keyword description is
554 // applicable. 554 // applicable.
555 i->description = template_url->AdjustedShortNameForLocaleDirection(); 555 i->description = template_url->AdjustedShortNameForLocaleDirection();
556 if (template_url->GetType() != TemplateURL::OMNIBOX_API_EXTENSION) { 556 if (template_url->type() != TemplateURL::OMNIBOX_API_EXTENSION) {
557 i->description = l10n_util::GetStringFUTF16( 557 i->description = l10n_util::GetStringFUTF16(
558 IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION, i->description); 558 IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION, i->description);
559 } 559 }
560 i->description_class.push_back( 560 i->description_class.push_back(
561 ACMatchClassification(0, ACMatchClassification::DIM)); 561 ACMatchClassification(0, ACMatchClassification::DIM));
562 } 562 }
563 last_keyword = i->keyword; 563 last_keyword = i->keyword;
564 } 564 }
565 } else { 565 } else {
566 last_keyword.clear(); 566 last_keyword.clear();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 expire_timer_.Stop(); 666 expire_timer_.Stop();
667 stop_timer_.Stop(); 667 stop_timer_.Stop();
668 done_ = true; 668 done_ = true;
669 if (clear_result && !result_.empty()) { 669 if (clear_result && !result_.empty()) {
670 result_.Reset(); 670 result_.Reset();
671 // NOTE: We pass in false since we're trying to only clear the popup, not 671 // NOTE: We pass in false since we're trying to only clear the popup, not
672 // touch the edit... this is all a mess and should be cleaned up :( 672 // touch the edit... this is all a mess and should be cleaned up :(
673 NotifyChanged(false); 673 NotifyChanged(false);
674 } 674 }
675 } 675 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698