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

Unified Diff: chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm

Issue 2016893002: [Material][Mac] Remove the colon in the selected keyword decoration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed test 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm
index 97522b5843d31bfd9fe36aec8d997e514be2857a..2e34a4d5517a027113f95271410ea9847d011805 100644
--- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm
@@ -66,20 +66,27 @@ void SelectedKeywordDecoration::SetKeyword(const base::string16& short_name,
bool is_extension_keyword) {
const base::string16 min_name(
location_bar_util::CalculateMinString(short_name));
- NSString* full_string = is_extension_keyword ?
- base::SysUTF16ToNSString(short_name) :
- l10n_util::GetNSStringF(IDS_OMNIBOX_KEYWORD_TEXT, short_name);
+ const int keyword_text_id = ui::MaterialDesignController::IsModeMaterial()
+ ? IDS_OMNIBOX_KEYWORD_TEXT_MD
+ : IDS_OMNIBOX_KEYWORD_TEXT;
+
+ NSString* full_string =
+ is_extension_keyword
+ ? base::SysUTF16ToNSString(short_name)
+ : l10n_util::GetNSStringF(keyword_text_id, short_name);
// The text will be like "Search <name>:". "<name>" is a parameter
- // derived from |short_name|.
+ // derived from |short_name|. If we're using Material Design, the text will
+ // be like "Search <name>" instead.
full_string_.reset([full_string copy]);
if (min_name.empty()) {
partial_string_.reset();
} else {
- NSString* partial_string = is_extension_keyword ?
- base::SysUTF16ToNSString(min_name) :
- l10n_util::GetNSStringF(IDS_OMNIBOX_KEYWORD_TEXT, min_name);
+ NSString* partial_string =
+ is_extension_keyword
+ ? base::SysUTF16ToNSString(min_name)
+ : l10n_util::GetNSStringF(keyword_text_id, min_name);
partial_string_.reset([partial_string copy]);
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698