Commit 1b71a23e authored by Ramya Nagarajan's avatar Ramya Nagarajan Committed by Commit Bot

[Mac] Adds icon for Emoji context menu item.

The 'Emoji & Symbols' item is part of the context menu for editable text
fields. This adds an emoji icon to be displayed along with the menu item
text. https://screenshot.googleplex.com/Css3YDJuuvX

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

Bug: 827404
Change-Id: I0f0f660803d2c871fcf157b905210a49bd14f140
Reviewed-on: https://chromium-review.googlesource.com/1007896
Commit-Queue: Ramya Nagarajan <ramyan@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550170}
parent bc2ee55f
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
#import "ui/base/cocoa/menu_controller.h" #import "ui/base/cocoa/menu_controller.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h" #include "ui/base/ui_base_features.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h" #include "ui/strings/grit/ui_strings.h"
using content::WebContents; using content::WebContents;
...@@ -352,8 +354,11 @@ void RenderViewContextMenuMac::InitToolkitMenu() { ...@@ -352,8 +354,11 @@ void RenderViewContextMenuMac::InitToolkitMenu() {
base::FeatureList::IsEnabled(features::kEnableEmojiContextMenu)) { base::FeatureList::IsEnabled(features::kEnableEmojiContextMenu)) {
// The "Emoji" item is available near the top of the context menu, after // The "Emoji" item is available near the top of the context menu, after
// any "Look Up" of selected text. // any "Look Up" of selected text.
menu_model_.InsertItemWithStringIdAt(index++, IDC_CONTENT_CONTEXT_EMOJI, menu_model_.InsertItemWithStringIdAt(index, IDC_CONTENT_CONTEXT_EMOJI,
IDS_CONTENT_CONTEXT_EMOJI); IDS_CONTENT_CONTEXT_EMOJI);
menu_model_.SetIcon(index++,
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_EMOJI_FAVICON));
menu_model_.InsertSeparatorAt(index++, ui::NORMAL_SEPARATOR); menu_model_.InsertSeparatorAt(index++, ui::NORMAL_SEPARATOR);
} }
......
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
<structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_UNLOCKED" file="common/easy_unlock_unlocked.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_UNLOCKED" file="common/easy_unlock_unlocked.png" />
<structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_UNLOCKED_HOVER" file="common/easy_unlock_unlocked_hover.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_UNLOCKED_HOVER" file="common/easy_unlock_unlocked_hover.png" />
<structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_UNLOCKED_PRESSED" file="common/easy_unlock_unlocked_pressed.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_UNLOCKED_PRESSED" file="common/easy_unlock_unlocked_pressed.png" />
<structure type="chrome_scaled_image" name="IDR_EMOJI_FAVICON" file="common/emoji_menu_item.png" />
<structure type="chrome_scaled_image" name="IDR_FOLDER_CLOSED" file="common/folder_closed.png" /> <structure type="chrome_scaled_image" name="IDR_FOLDER_CLOSED" file="common/folder_closed.png" />
<structure type="chrome_scaled_image" name="IDR_FOLDER_CLOSED_RTL" file="common/folder_closed_rtl.png" /> <structure type="chrome_scaled_image" name="IDR_FOLDER_CLOSED_RTL" file="common/folder_closed_rtl.png" />
<if expr="is_macosx"> <if expr="is_macosx">
......
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