Commit 5f7ab7ba authored by wutao's avatar wutao Committed by Commit Bot

cros: Add shortcuts metadata and strings. KSV - part 8.

This cl adds all shortcuts metadata and strings for Keyboard Shortcut
Viewer (KSV).

Bug: 768932
Test: KeyboardShortcutViewerMetadataTest and Manually tested on device
Change-Id: I0dc85fa4bffb5a9a1f19b86e991faf7b13b75a93
Reviewed-on: https://chromium-review.googlesource.com/922389
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537415}
parent 5e8d978c
...@@ -338,53 +338,53 @@ ...@@ -338,53 +338,53 @@
"messages": [25920], "messages": [25920],
}, },
"ui/file_manager/file_manager_resources.grd": { "ui/file_manager/file_manager_resources.grd": {
"includes": [26150], "includes": [26650],
}, },
"ui/keyboard/keyboard_resources.grd": { "ui/keyboard/keyboard_resources.grd": {
"includes": [26400], "includes": [26900],
}, },
"ui/login/login_resources.grd": { "ui/login/login_resources.grd": {
"includes": [26500], "includes": [27000],
}, },
"ui/resources/ui_resources.grd": { "ui/resources/ui_resources.grd": {
"structures": [26600], "structures": [27100],
}, },
"ui/resources/ui_unscaled_resources.grd": { "ui/resources/ui_unscaled_resources.grd": {
"includes": [26850], "includes": [27350],
}, },
"ui/strings/app_locale_settings.grd": { "ui/strings/app_locale_settings.grd": {
"messages": [26900], "messages": [27400],
}, },
"ui/strings/ui_strings.grd": { "ui/strings/ui_strings.grd": {
"messages": [26950], "messages": [27450],
}, },
"ui/views/resources/views_resources.grd": { "ui/views/resources/views_resources.grd": {
"structures": [27150], "structures": [27650],
}, },
"ui/webui/resources/webui_resources.grd": { "ui/webui/resources/webui_resources.grd": {
"includes": [27450], "includes": [27950],
"structures": [27650], "structures": [28150],
}, },
# This file is generated during the build. # This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": { "<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": {
"includes": [28450], "includes": [28950],
}, },
"devtools_resources.grd": { "devtools_resources.grd": {
"includes": [28450], "includes": [28950],
}, },
"cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": { "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": {
"includes": [28600], "includes": [29100],
"messages": [28650], "messages": [29150],
}, },
"third_party/libaddressinput/chromium/address_input_strings.grd": { "third_party/libaddressinput/chromium/address_input_strings.grd": {
"messages": [28700], "messages": [29200],
}, },
"mojo/public/js/mojo_bindings_resources.grd": { "mojo/public/js/mojo_bindings_resources.grd": {
"includes": [28800], "includes": [29300],
}, },
# END "everything else" section. # END "everything else" section.
# Everything but chrome/, components/, content/, and ios/ # Everything but chrome/, components/, content/, and ios/
......
...@@ -89,8 +89,9 @@ KeyboardShortcutItemView::KeyboardShortcutItemView( ...@@ -89,8 +89,9 @@ KeyboardShortcutItemView::KeyboardShortcutItemView(
shortcut_label_view_->SetHorizontalAlignment( shortcut_label_view_->SetHorizontalAlignment(
base::i18n::IsRTL() ? gfx::ALIGN_LEFT : gfx::ALIGN_RIGHT); base::i18n::IsRTL() ? gfx::ALIGN_LEFT : gfx::ALIGN_RIGHT);
DCHECK_EQ(replacement_strings.size(), offsets.size()); DCHECK_EQ(replacement_strings.size(), offsets.size());
// If the replacement string is " ", it indicates to insert a seperator view. // TODO(wutao): make this reliable.
const base::string16 separator_string = base::ASCIIToUTF16(" "); // If the replacement string is "+ ", it indicates to insert a seperator view.
const base::string16 separator_string = base::ASCIIToUTF16("+ ");
for (size_t i = 0; i < offsets.size(); ++i) { for (size_t i = 0; i < offsets.size(); ++i) {
views::StyledLabel::RangeStyleInfo style_info; views::StyledLabel::RangeStyleInfo style_info;
style_info.disable_line_wrapping = true; style_info.disable_line_wrapping = true;
......
...@@ -35,6 +35,8 @@ KSVSearchBoxView::KSVSearchBoxView(search_box::SearchBoxViewDelegate* delegate) ...@@ -35,6 +35,8 @@ KSVSearchBoxView::KSVSearchBoxView(search_box::SearchBoxViewDelegate* delegate)
search_box()->set_placeholder_text( search_box()->set_placeholder_text(
l10n_util::GetStringUTF16(IDS_KSV_SEARCH_BOX_PLACEHOLDER)); l10n_util::GetStringUTF16(IDS_KSV_SEARCH_BOX_PLACEHOLDER));
search_box()->set_placeholder_text_draw_flags(gfx::Canvas::TEXT_ALIGN_CENTER); search_box()->set_placeholder_text_draw_flags(gfx::Canvas::TEXT_ALIGN_CENTER);
search_box()->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_KSV_SEARCH_BOX_ACCESSIBILITY_NAME));
constexpr SkColor kSearchBarIconColor = constexpr SkColor kSearchBarIconColor =
SkColorSetARGBMacro(0xFF, 0x3C, 0x40, 0x43); SkColorSetARGBMacro(0xFF, 0x3C, 0x40, 0x43);
...@@ -77,19 +79,22 @@ void KSVSearchBoxView::SetupCloseButton() { ...@@ -77,19 +79,22 @@ void KSVSearchBoxView::SetupCloseButton() {
close->SetSize(gfx::Size(kIconSize, kIconSize)); close->SetSize(gfx::Size(kIconSize, kIconSize));
close->SetImageAlignment(views::ImageButton::ALIGN_CENTER, close->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE); views::ImageButton::ALIGN_MIDDLE);
close->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_KSV_CLEAR_SEARCHBOX_ACCESSIBILITY_NAME));
close->SetVisible(false); close->SetVisible(false);
} }
void KSVSearchBoxView::SetupBackButton() { void KSVSearchBoxView::SetupBackButton() {
constexpr SkColor kBackIconColor = constexpr SkColor kBackIconColor =
SkColorSetARGBMacro(0xFF, 0x42, 0x85, 0xF4); SkColorSetARGBMacro(0xFF, 0x42, 0x85, 0xF4);
views::ImageButton* back = back_button(); views::ImageButton* back = back_button();
back->SetImage(views::ImageButton::STATE_NORMAL, back->SetImage(views::ImageButton::STATE_NORMAL,
gfx::CreateVectorIcon(kKsvSearchBackIcon, kBackIconColor)); gfx::CreateVectorIcon(kKsvSearchBackIcon, kBackIconColor));
back->SetSize(gfx::Size(kIconSize, kIconSize)); back->SetSize(gfx::Size(kIconSize, kIconSize));
back->SetImageAlignment(views::ImageButton::ALIGN_CENTER, back->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE); views::ImageButton::ALIGN_MIDDLE);
back->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_KSV_BACK_ACCESSIBILITY_NAME));
back->SetVisible(false); back->SetVisible(false);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment