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( ...@@ -163,7 +163,6 @@ SuggestionStatus EmojiSuggester::HandleKeyEvent(
if (highlighted_index_ == kNoneHighlighted && buttons_.size() > 0) { if (highlighted_index_ == kNoneHighlighted && buttons_.size() > 0) {
if (event.key == "Down" || event.key == "Up") { if (event.key == "Down" || event.key == "Up") {
highlighted_index_ = event.key == "Down" ? 0 : buttons_.size() - 1; highlighted_index_ = event.key == "Down" ? 0 : buttons_.size() - 1;
ShowSuggestionWindowWithIndices(true);
SetButtonHighlighted(buttons_[highlighted_index_], true); SetButtonHighlighted(buttons_[highlighted_index_], true);
return SuggestionStatus::kBrowsing; return SuggestionStatus::kBrowsing;
} }
...@@ -243,7 +242,7 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) { ...@@ -243,7 +242,7 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) {
kEmojiSuggesterShowSettingMaxCount; kEmojiSuggesterShowSettingMaxCount;
IncrementPrefValueTilCapped(kEmojiSuggesterShowSettingCount, IncrementPrefValueTilCapped(kEmojiSuggesterShowSettingCount,
kEmojiSuggesterShowSettingMaxCount); kEmojiSuggesterShowSettingMaxCount);
ShowSuggestionWindowWithIndices(false); ShowSuggestionWindow();
session_start_ = base::TimeTicks::Now(); session_start_ = base::TimeTicks::Now();
buttons_.clear(); buttons_.clear();
...@@ -259,8 +258,7 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) { ...@@ -259,8 +258,7 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) {
} }
} }
void EmojiSuggester::ShowSuggestionWindowWithIndices(bool show_indices) { void EmojiSuggester::ShowSuggestionWindow() {
properties_.show_indices = show_indices;
std::string error; std::string error;
suggestion_handler_->SetAssistiveWindowProperties(context_id_, properties_, suggestion_handler_->SetAssistiveWindowProperties(context_id_, properties_,
&error); &error);
......
...@@ -45,7 +45,7 @@ class EmojiSuggester : public Suggester { ...@@ -45,7 +45,7 @@ class EmojiSuggester : public Suggester {
private: private:
void ShowSuggestion(const std::string& text); void ShowSuggestion(const std::string& text);
void ShowSuggestionWindowWithIndices(bool show_indices); void ShowSuggestionWindow();
void LoadEmojiMap(); void LoadEmojiMap();
void OnEmojiDataLoaded(const std::string& emoji_data); void OnEmojiDataLoaded(const std::string& emoji_data);
void RecordAcceptanceIndex(int index); void RecordAcceptanceIndex(int index);
......
...@@ -329,11 +329,11 @@ TEST_F(EmojiSuggesterTest, DoesNotShowIndicesWhenFirstSuggesting) { ...@@ -329,11 +329,11 @@ TEST_F(EmojiSuggesterTest, DoesNotShowIndicesWhenFirstSuggesting) {
engine_->VerifyShowIndices(false); engine_->VerifyShowIndices(false);
} }
TEST_F(EmojiSuggesterTest, ShowsIndexAfterPressingDown) { TEST_F(EmojiSuggesterTest, DoesNotShowIndexAfterPressingDown) {
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy "))); EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
Press("Down"); Press("Down");
engine_->VerifyShowIndices(true); engine_->VerifyShowIndices(false);
} }
TEST_F(EmojiSuggesterTest, DoesNotShowIndicesAfterGettingSuggestionsTwice) { 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