Skip to content

Commit

Permalink
[Mac] Adds Emoji context menu icon in MacViews.
Browse files Browse the repository at this point in the history
This change adds an emoji icon to be shown along with the menu text.
https://screenshot.googleplex.com/LO3aKXYwaqc.

For more details, see http://go/chrome-emojisertion.

Bug: 827404

Change-Id: I2b480a7a60ca92ceeb042bdc347ebb5441fd71f7
Reviewed-on: https://chromium-review.googlesource.com/1010978
Reviewed-by: ccameron <[email protected]>
Commit-Queue: Ramya Nagarajan <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#550507}(cherry picked from commit 5824f15)
Reviewed-on: https://chromium-review.googlesource.com/1014203
Cr-Commit-Position: refs/branch-heads/3396@{#57}
Cr-Branched-From: 9ef2aa8-refs/heads/master@{#550428}
  • Loading branch information
Ramya Nagarajan authored and asvitkine-chromium committed Apr 17, 2018
1 parent 31940c3 commit 11ecb03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/views/controls/views_text_services_context_menu_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#include "ui/base/cocoa/text_services_context_menu.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/decorated_text.h"
#import "ui/gfx/decorated_text_mac.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/view.h"
Expand Down Expand Up @@ -42,8 +44,11 @@
menu->InsertSeparatorAt(index++, ui::NORMAL_SEPARATOR);
}
if (base::FeatureList::IsEnabled(features::kEnableEmojiContextMenu)) {
menu->InsertItemWithStringIdAt(index++, IDS_CONTENT_CONTEXT_EMOJI,
menu->InsertItemWithStringIdAt(index, IDS_CONTENT_CONTEXT_EMOJI,
IDS_CONTENT_CONTEXT_EMOJI);
menu->SetIcon(index++,
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_EMOJI_FAVICON));
menu->InsertSeparatorAt(index++, ui::NORMAL_SEPARATOR);
}
text_services_menu_.AppendToContextMenu(menu);
Expand Down

0 comments on commit 11ecb03

Please sign in to comment.