Skip to content

Commit

Permalink
[Mac] Adds icon for Emoji context menu item.
Browse files Browse the repository at this point in the history
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: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550170}
  • Loading branch information
Ramya Nagarajan authored and Commit Bot committed Apr 12, 2018
1 parent bc2ee55 commit 1b71a23
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include "content/public/browser/render_widget_host_view.h"
#import "ui/base/cocoa/menu_controller.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"

using content::WebContents;
Expand Down Expand Up @@ -352,8 +354,11 @@ void UpdateMenuItem(int command_id,
base::FeatureList::IsEnabled(features::kEnableEmojiContextMenu)) {
// The "Emoji" item is available near the top of the context menu, after
// 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);
menu_model_.SetIcon(index++,
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_EMOJI_FAVICON));
menu_model_.InsertSeparatorAt(index++, ui::NORMAL_SEPARATOR);
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ui/resources/ui_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -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_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_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_RTL" file="common/folder_closed_rtl.png" />
<if expr="is_macosx">
Expand Down

0 comments on commit 1b71a23

Please sign in to comment.