Commit 74f3e724 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

Add emoji inserted ChromeVox string

Let's get the string in first. I will decide on the method signature
later.

Bug: 1113612, 1119570
Change-Id: I7fab36cfa1a16ca0d9f48144ae596153dc308ffe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2365513Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799931}
parent 2bca8c96
...@@ -5697,6 +5697,12 @@ You can manage this account’s settings by installing the Family Link app on yo ...@@ -5697,6 +5697,12 @@ You can manage this account’s settings by installing the Family Link app on yo
<message name="IDS_SUGGESTION_DISMISSED" desc="String announced by screenreader when suggestion pop-up disappears."> <message name="IDS_SUGGESTION_DISMISSED" desc="String announced by screenreader when suggestion pop-up disappears.">
Suggestion dismissed Suggestion dismissed
</message> </message>
<message name="IDS_SUGGESTION_EMOJI_INSERTED" desc="String announced by screenreader when an emoji suggestion is inserted.">
Emoji inserted
</message>
<message name="IDS_SUGGESTION_INSERTED" desc="String announced by screenreader when a suggestion is inserted.">
Suggestion inserted
</message>
<!-- Strings for Custom Tab UI --> <!-- Strings for Custom Tab UI -->
<message name="IDS_CUSTOM_TABS_ACTION_MENU_ACCESSIBLE_NAME" desc="Accessible name for the overflow menu of the Chrome Custom Tab toolbar."> <message name="IDS_CUSTOM_TABS_ACTION_MENU_ACCESSIBLE_NAME" desc="Accessible name for the overflow menu of the Chrome Custom Tab toolbar.">
......
a6b8756e9be63c0e3ea06369375dfc013d505870
\ No newline at end of file
a6b8756e9be63c0e3ea06369375dfc013d505870
\ No newline at end of file
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
#include "chrome/browser/chromeos/input_method/assistive_window_properties.h" #include "chrome/browser/chromeos/input_method/assistive_window_properties.h"
#include "chrome/browser/chromeos/input_method/ui/suggestion_details.h" #include "chrome/browser/chromeos/input_method/ui/suggestion_details.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "ui/base/ime/chromeos/ime_bridge.h" #include "ui/base/ime/chromeos/ime_bridge.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
namespace chromeos { namespace chromeos {
...@@ -123,10 +125,16 @@ void AssistiveWindowController::OnWidgetClosing(views::Widget* widget) { ...@@ -123,10 +125,16 @@ void AssistiveWindowController::OnWidgetClosing(views::Widget* widget) {
} }
} }
// TODO(crbug/1119570): Update AcceptSuggestion signature (either use
// announce_string, or no string)
void AssistiveWindowController::AcceptSuggestion( void AssistiveWindowController::AcceptSuggestion(
const base::string16& suggestion) { const base::string16& suggestion) {
tts_handler_->Announce(base::StringPrintf( if (window_.type == ui::ime::AssistiveWindowType::kEmojiSuggestion) {
"%s inserted.", base::UTF16ToUTF8(suggestion).c_str())); tts_handler_->Announce(
l10n_util::GetStringUTF8(IDS_SUGGESTION_EMOJI_SUGGESTED));
} else {
tts_handler_->Announce(l10n_util::GetStringUTF8(IDS_SUGGESTION_INSERTED));
}
HideSuggestion(); HideSuggestion();
} }
...@@ -211,7 +219,7 @@ void AssistiveWindowController::SetAssistiveWindowProperties( ...@@ -211,7 +219,7 @@ void AssistiveWindowController::SetAssistiveWindowProperties(
InitUndoWindow(); InitUndoWindow();
if (window.visible) { if (window.visible) {
undo_window_->SetAnchorRect(bounds_.autocorrect.IsEmpty() undo_window_->SetAnchorRect(bounds_.autocorrect.IsEmpty()
? bounds_.caret ? bounds_.caret
: bounds_.autocorrect); : bounds_.autocorrect);
undo_window_->Show(); undo_window_->Show();
} else { } else {
......
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