Commit 52e88633 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

[EmojiSuggest] Remove showing indices

As per UXimpl feedback, remove showing indices for emoji suggestions.

Bug: b/165761951
Change-Id: Idc5363b71a6992b31db0d450516332b929d3c73c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371423Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800913}
parent 80b44851
......@@ -163,7 +163,6 @@ SuggestionStatus EmojiSuggester::HandleKeyEvent(
if (highlighted_index_ == kNoneHighlighted && buttons_.size() > 0) {
if (event.key == "Down" || event.key == "Up") {
highlighted_index_ = event.key == "Down" ? 0 : buttons_.size() - 1;
ShowSuggestionWindowWithIndices(true);
SetButtonHighlighted(buttons_[highlighted_index_], true);
return SuggestionStatus::kBrowsing;
}
......@@ -243,7 +242,7 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) {
kEmojiSuggesterShowSettingMaxCount;
IncrementPrefValueTilCapped(kEmojiSuggesterShowSettingCount,
kEmojiSuggesterShowSettingMaxCount);
ShowSuggestionWindowWithIndices(false);
ShowSuggestionWindow();
session_start_ = base::TimeTicks::Now();
buttons_.clear();
......@@ -259,8 +258,7 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) {
}
}
void EmojiSuggester::ShowSuggestionWindowWithIndices(bool show_indices) {
properties_.show_indices = show_indices;
void EmojiSuggester::ShowSuggestionWindow() {
std::string error;
suggestion_handler_->SetAssistiveWindowProperties(context_id_, properties_,
&error);
......
......@@ -45,7 +45,7 @@ class EmojiSuggester : public Suggester {
private:
void ShowSuggestion(const std::string& text);
void ShowSuggestionWindowWithIndices(bool show_indices);
void ShowSuggestionWindow();
void LoadEmojiMap();
void OnEmojiDataLoaded(const std::string& emoji_data);
void RecordAcceptanceIndex(int index);
......
......@@ -329,11 +329,11 @@ TEST_F(EmojiSuggesterTest, DoesNotShowIndicesWhenFirstSuggesting) {
engine_->VerifyShowIndices(false);
}
TEST_F(EmojiSuggesterTest, ShowsIndexAfterPressingDown) {
TEST_F(EmojiSuggesterTest, DoesNotShowIndexAfterPressingDown) {
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
Press("Down");
engine_->VerifyShowIndices(true);
engine_->VerifyShowIndices(false);
}
TEST_F(EmojiSuggesterTest, DoesNotShowIndicesAfterGettingSuggestionsTwice) {
......
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