Commit 3e6a0776 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

Limit to 5 emoji suggestions

Since arrow is needed to indicate more emojis available.
Only loads 5 emojis for now until arrow is implemented.

Bug: 1093179
Test: manual
Change-Id: I1218c860d379510d3337cfd18244b1c5c9eb1b19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2237505Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776854}
parent cc832214
...@@ -100,6 +100,10 @@ void EmojiSuggester::OnEmojiDataLoaded(const std::string& emoji_data) { ...@@ -100,6 +100,10 @@ void EmojiSuggester::OnEmojiDataLoaded(const std::string& emoji_data) {
std::string emojis = line.substr(comma_pos + 1); std::string emojis = line.substr(comma_pos + 1);
// Build emoji_map_ from splitting the string of emojis. // Build emoji_map_ from splitting the string of emojis.
emoji_map_[word] = SplitString(emojis, ";"); emoji_map_[word] = SplitString(emojis, ";");
// TODO(crbug/1093179): Implement arrow to indicate more emojis available.
// Only loads 5 emojis for now until arrow is implemented.
if (emoji_map_[word].size() > kMaxCandidateSize)
emoji_map_[word].resize(kMaxCandidateSize);
DCHECK_LE(static_cast<int>(emoji_map_[word].size()), kMaxSuggestionSize); DCHECK_LE(static_cast<int>(emoji_map_[word].size()), kMaxSuggestionSize);
} }
} }
......
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