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

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

Issue 1998493002: Update omnibox chips in MD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
Index: chrome/browser/ui/views/location_bar/selected_keyword_view.cc
diff --git a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
index fc03c1f925630c79519f2cac109c7cce1f15e568..57249c3e404827d42ca316fbc126b9c34d7b106b 100644
--- a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
+++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
@@ -56,10 +56,10 @@ SkColor SelectedKeywordView::GetTextColor() const {
if (!ui::MaterialDesignController::IsModeMaterial())
return text_color_;
- return color_utils::IsDark(GetParentBackgroundColor())
- ? gfx::kGoogleBlue700
- : GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_LinkEnabled);
+ return GetNativeTheme()->GetSystemColor(
+ color_utils::IsDark(GetParentBackgroundColor())
+ ? ui::NativeTheme::kColorId_TextfieldDefaultColor
+ : ui::NativeTheme::kColorId_LinkEnabled);
}
SkColor SelectedKeywordView::GetBorderColor() const {
@@ -96,16 +96,19 @@ void SelectedKeywordView::SetKeyword(const base::string16& keyword) {
bool is_extension_keyword;
const base::string16 short_name =
model->GetKeywordShortName(keyword, &is_extension_keyword);
- const base::string16 full_name = is_extension_keyword ?
- short_name :
- l10n_util::GetStringFUTF16(IDS_OMNIBOX_KEYWORD_TEXT, short_name);
+ int keyword_text_id = ui::MaterialDesignController::IsModeMaterial()
+ ? IDS_OMNIBOX_KEYWORD_TEXT_MD
+ : IDS_OMNIBOX_KEYWORD_TEXT;
+ const base::string16 full_name =
+ is_extension_keyword ? short_name : l10n_util::GetStringFUTF16(
+ keyword_text_id, short_name);
full_label_.SetText(full_name);
const base::string16 min_string(
location_bar_util::CalculateMinString(short_name));
- const base::string16 partial_name = is_extension_keyword ?
- min_string :
- l10n_util::GetStringFUTF16(IDS_OMNIBOX_KEYWORD_TEXT, min_string);
+ const base::string16 partial_name =
+ is_extension_keyword ? min_string : l10n_util::GetStringFUTF16(
+ keyword_text_id, min_string);
partial_label_.SetText(min_string.empty() ?
full_label_.text() : partial_name);
}
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698