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

Unified Diff: chrome/browser/views/location_bar/selected_keyword_view.cc

Issue 2078021: First pass at experimental omnibox API. There are plenty of rough edges and (Closed)
Patch Set: no prefer_keyword Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/location_bar/keyword_hint_view.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/location_bar/selected_keyword_view.cc
diff --git a/chrome/browser/views/location_bar/selected_keyword_view.cc b/chrome/browser/views/location_bar/selected_keyword_view.cc
index 47779bc263321f326e424e7a950954848521cbc6..4bcb827c66ceec4d21798bb7f05ff42779a2f760 100644
--- a/chrome/browser/views/location_bar/selected_keyword_view.cc
+++ b/chrome/browser/views/location_bar/selected_keyword_view.cc
@@ -7,6 +7,7 @@
#include "app/l10n_util.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/views/location_bar/keyword_hint_view.h"
#include "grit/generated_resources.h"
@@ -56,14 +57,16 @@ void SelectedKeywordView::SetKeyword(const std::wstring& keyword) {
if (!profile_->GetTemplateURLModel())
return;
- const std::wstring short_name =
- KeywordHintView::GetKeywordName(profile_, keyword);
- full_label_.SetText(l10n_util::GetStringF(IDS_OMNIBOX_KEYWORD_TEXT,
- short_name));
+ bool is_extension_keyword;
+ const std::wstring short_name = profile_->GetTemplateURLModel()->
+ GetKeywordShortName(keyword, &is_extension_keyword);
+ int message_id = is_extension_keyword ?
+ IDS_OMNIBOX_EXTENSION_KEYWORD_TEXT : IDS_OMNIBOX_KEYWORD_TEXT;
+ full_label_.SetText(l10n_util::GetStringF(message_id, short_name));
const std::wstring min_string = CalculateMinString(short_name);
partial_label_.SetText(min_string.empty() ?
full_label_.GetText() :
- l10n_util::GetStringF(IDS_OMNIBOX_KEYWORD_TEXT, min_string));
+ l10n_util::GetStringF(message_id, min_string));
}
std::wstring SelectedKeywordView::CalculateMinString(
« no previous file with comments | « chrome/browser/views/location_bar/keyword_hint_view.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698