Commit 4f9cbfe7 authored by Sebastien Lalancette's avatar Sebastien Lalancette Committed by Commit Bot

[iOS] Updating Context Menu Copy Icon and Strings

- Added final Copy Link URL icon,
- Fixed the string for Copy Link URL action,
- Fixed the string used for Open in New Window action title (it should
  not have a capital 'i'),
- Fixed new menu's Open in Incognito string.

This CL adds the first icon (copy_link_url) for the new actions. If the
proposed pattern is acceptable then the remaining icons will follow a
similar pattern.
- Icon resource under ui/menu/,
- No "menu" prefix to the icon name,
- PNGs with different scales used instead of PDF,
- Template icon, to allow menus to set the color.

Bug: 1093302
Change-Id: Ie22d50d78a4d38c56f9c04cfc2c9cbb66d83ef0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343320
Commit-Queue: Sebastien Lalancette <seblalancette@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796408}
parent 613235c2
......@@ -357,12 +357,12 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_AUTOFILL_SET_UP_SCREENLOCK_CONTENT" desc="Message informing the user that in order to use the password, a screen lock needs to be set up on the device. This is shown as an alert message after the user tries to view or copy the password from a settings page. [CHAR_LIMIT=100]">
To use passwords, you must first set a passcode on your device.
</message>
<message name="IDS_IOS_COPY_ACTION_TITLE" desc="Title of the action used to copy the selected piece of content to the clipboard. Targeted content type includes URL or image. [iOS only]">
Copy
</message>
<message name="IDS_IOS_DELETE_ACTION_TITLE" desc="Title of the action used to delete a selected item. Item types include, for example, a Bookmark or an History Entry. [iOS only]">
Delete
</message>
<message name="IDS_IOS_OPEN_IN_INCOGNITO_ACTION_TITLE" desc="Title of the action used to open an URL in a new Incognito tab. [iOS only]">
Open in Incognito
</message>
<message name="IDS_IOS_BADGE_INCOGNITO_HINT" desc="Button displayed when the user is in Incognito mode. [iOS only]">
Current Webpage is on Incognito
</message>
......@@ -616,7 +616,7 @@ locale. The strings in this file are specific to iOS.
Open
</message>
<message name="IDS_IOS_CONTENT_CONTEXT_OPENINNEWWINDOW" desc="The iOS menu item for opening a link in a new window. [iOS only]">
Open In New Window
Open in New Window
</message>
<message name="IDS_IOS_CONTENT_CONTEXT_OPENIMAGE" desc="The name of the Open Image command in the content area context menu">
Open Image
......
2589d145f8e666dad0b925a24d010fd5bb7a342b
\ No newline at end of file
b7f2e1d1ccbf5bb66cf754f620214caa77b38df9
\ No newline at end of file
9caa7694a2ef308a353a2ab234f4f1ba44920f86
\ No newline at end of file
b7f2e1d1ccbf5bb66cf754f620214caa77b38df9
\ No newline at end of file
......@@ -12,6 +12,7 @@ source_set("menu") {
]
configs += [ "//build/config/compiler:enable_arc" ]
deps = [
"resources:copy_link_url",
"//base",
"//ios/chrome/app/strings",
"//ios/chrome/browser/ui/commands",
......@@ -30,6 +31,7 @@ source_set("unit_tests") {
sources = [ "action_factory_unittest.mm" ]
deps = [
":menu",
"resources:copy_link_url",
"//base",
"//base/test:test_support",
"//ios/chrome/app/strings",
......
......@@ -59,12 +59,13 @@
}
- (UIAction*)actionToCopyURL:(const GURL)URL {
return [self actionWithTitle:l10n_util::GetNSString(IDS_IOS_COPY_ACTION_TITLE)
image:[UIImage systemImageNamed:@"doc.on.doc"]
type:MenuActionType::Copy
block:^{
StoreURLInPasteboard(URL);
}];
return
[self actionWithTitle:l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_COPY)
image:[UIImage imageNamed:@"copy_link_url"]
type:MenuActionType::Copy
block:^{
StoreURLInPasteboard(URL);
}];
}
- (UIAction*)actionToDeleteWithBlock:(ProceduralBlock)block {
......@@ -113,12 +114,11 @@
}
- (UIAction*)actionToOpenInNewIncognitoTabWithBlock:(ProceduralBlock)block {
return
[self actionWithTitle:l10n_util::GetNSString(
IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB)
image:nil
type:MenuActionType::OpenInNewIncognitoTab
block:block];
return [self actionWithTitle:l10n_util::GetNSString(
IDS_IOS_OPEN_IN_INCOGNITO_ACTION_TITLE)
image:nil
type:MenuActionType::OpenInNewIncognitoTab
block:block];
}
- (UIAction*)actionToOpenInNewWindowWithURL:(const GURL)URL
......
......@@ -96,8 +96,9 @@ TEST_F(ActionFactoryTest, CopyAction) {
[[ActionFactory alloc] initWithBrowser:test_browser_.get()
scenario:kTestMenuScenario];
UIImage* expectedImage = [UIImage systemImageNamed:@"doc.on.doc"];
NSString* expectedTitle = l10n_util::GetNSString(IDS_IOS_COPY_ACTION_TITLE);
UIImage* expectedImage = [UIImage imageNamed:@"copy_link_url"];
NSString* expectedTitle =
l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_COPY);
GURL testURL = GURL("https://example.com");
......@@ -162,7 +163,7 @@ TEST_F(ActionFactoryTest, OpenInNewIncognitoTabAction_URL) {
GURL testURL = GURL("https://example.com");
NSString* expectedTitle =
l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB);
l10n_util::GetNSString(IDS_IOS_OPEN_IN_INCOGNITO_ACTION_TITLE);
UIAction* actionWithURL =
[factory actionToOpenInNewIncognitoTabWithURL:testURL completion:nil];
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ios/asset_catalog.gni")
imageset("copy_link_url") {
sources = [
"copy_link_url.imageset/Contents.json",
"copy_link_url.imageset/copy_link_url@2x.png",
"copy_link_url.imageset/copy_link_url@3x.png",
]
}
{
"images" : [
{
"idiom" : "universal",
"filename" : "copy_link_url@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "copy_link_url@3x.png",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent": "template"
}
}
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