Commit 2402e6e7 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Add announcements for the bubble tips

This CL adds announcements to be read with VoiceOver for the in product
helps.

Bug: 866936
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ie89fa1b2b0179a8070351c2ce926ac18158ebdef
Reviewed-on: https://chromium-review.googlesource.com/1154536Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579336}
parent e64db336
...@@ -156,6 +156,9 @@ locale. The strings in this file are specific to iOS. ...@@ -156,6 +156,9 @@ locale. The strings in this file are specific to iOS.
Chromium has features that help you manage your internet data and how quickly you're able to load webpages. Chromium has features that help you manage your internet data and how quickly you're able to load webpages.
<ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph> <ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph>
</message> </message>
<message name="IDS_IOS_BOTTOM_TOOLBAR_IPH_PROMOTION_VOICE_OVER" desc="Text to be read by VoiceOver when the Bottom Toolbar Tip is presented to the user, explaining that the bottom toolbar can be used to reach some controls. Read by Text-to-Speech. [iOS only]">
Chromium tip. Some buttons are now at the bottom of your screen, like Back, Forward, and Search.
</message>
<message name="IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_DESCRIPTION" desc="Description of the dialog informing the user that their Chromium browsing history was deleted, but other forms of history can still be found on Google My Activity."> <message name="IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_DESCRIPTION" desc="Description of the dialog informing the user that their Chromium browsing history was deleted, but other forms of history can still be found on Google My Activity.">
The selected data has been removed from Chromium and synced devices. Your Google Account may have other forms of browsing history like searches and activity from other Google services at history.google.com. The selected data has been removed from Chromium and synced devices. Your Google Account may have other forms of browsing history like searches and activity from other Google services at history.google.com.
</message> </message>
...@@ -195,6 +198,9 @@ locale. The strings in this file are specific to iOS. ...@@ -195,6 +198,9 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_LOGIN_ERROR_AUTHENTICATING_HOSTED" desc="Couldn't sign in because hosted account is used."> <message name="IDS_IOS_LOGIN_ERROR_AUTHENTICATING_HOSTED" desc="Couldn't sign in because hosted account is used.">
Your account does not work on Chromium. Please contact your domain administrator or use a regular Google Account to sign in. Your account does not work on Chromium. Please contact your domain administrator or use a regular Google Account to sign in.
</message> </message>
<message name="IDS_IOS_LONG_PRESS_TOOLBAR_IPH_PROMOTION_VOICE_OVER" desc="Text to be read by VoiceOver when the LongPress Toolbar Tip is presented to the user. Read by Text-to-Speech.">
Chromium tip. For more tab options, press and hold the Show Tabs button in the toolbar, which is at the bottom or top of your screen.
</message>
<message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaini ng that signing out of a managed account will clear all the Chromium data.[Length: 200em, may be line wrapped to multiple lines at run time.]."> <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaini ng that signing out of a managed account will clear all the Chromium data.[Length: 200em, may be line wrapped to multiple lines at run time.].">
You are signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>. This will delete your Chromium data from this device, but your data will remain in your Google account. You are signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>. This will delete your Chromium data from this device, but your data will remain in your Google account.
</message> </message>
......
...@@ -156,6 +156,9 @@ locale. The strings in this file are specific to iOS. ...@@ -156,6 +156,9 @@ locale. The strings in this file are specific to iOS.
Google Chrome has features that help you manage your internet data and how quickly you're able to load webpages. Google Chrome has features that help you manage your internet data and how quickly you're able to load webpages.
<ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph> <ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph>
</message> </message>
<message name="IDS_IOS_BOTTOM_TOOLBAR_IPH_PROMOTION_VOICE_OVER" desc="Text to be read by VoiceOver when the Bottom Toolbar Tip is presented to the user, explaining that the bottom toolbar can be used to reach some controls. Read by Text-to-Speech. [iOS only]">
Chrome tip. Some buttons are now at the bottom of your screen, like Back, Forward, and Search.
</message>
<message name="IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_DESCRIPTION" desc="Description of the dialog informing the user that their Chrome browsing history was deleted, but other forms of history can still be found on Google My Activity."> <message name="IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_DESCRIPTION" desc="Description of the dialog informing the user that their Chrome browsing history was deleted, but other forms of history can still be found on Google My Activity.">
The selected data has been removed from Chrome and synced devices. Your Google Account may have other forms of browsing history like searches and activity from other Google services at history.google.com. The selected data has been removed from Chrome and synced devices. Your Google Account may have other forms of browsing history like searches and activity from other Google services at history.google.com.
</message> </message>
...@@ -195,6 +198,9 @@ locale. The strings in this file are specific to iOS. ...@@ -195,6 +198,9 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_LOGIN_ERROR_AUTHENTICATING_HOSTED" desc="Couldn't sign in because hosted account is used."> <message name="IDS_IOS_LOGIN_ERROR_AUTHENTICATING_HOSTED" desc="Couldn't sign in because hosted account is used.">
Your account does not work on Google Chrome. Please contact your domain administrator or use a regular Google Account to sign in. Your account does not work on Google Chrome. Please contact your domain administrator or use a regular Google Account to sign in.
</message> </message>
<message name="IDS_IOS_LONG_PRESS_TOOLBAR_IPH_PROMOTION_VOICE_OVER" desc="Text to be read by VoiceOver when the LongPress Toolbar Tip is presented to the user. Read by Text-to-Speech.">
Chrome tip. For more tab options, press and hold the Show Tabs button in the toolbar, which is at the bottom or top of your screen.
</message>
<message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaini ng that signing out of a managed account will clear all the Chrome data.[Length: 200em, may be line wrapped to multiple lines at run time.]."> <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaini ng that signing out of a managed account will clear all the Chrome data.[Length: 200em, may be line wrapped to multiple lines at run time.].">
You are signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>. This will delete your Chrome data from this device, but your data will remain in your Google account. You are signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>. This will delete your Chrome data from this device, but your data will remain in your Google account.
</message> </message>
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h"
#import "ios/chrome/browser/ui/util/named_guide.h" #import "ios/chrome/browser/ui/util/named_guide.h"
#import "ios/chrome/browser/ui/util/named_guide_util.h" #import "ios/chrome/browser/ui/util/named_guide_util.h"
#include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/web/public/web_state/ui/crw_web_view_proxy.h" #import "ios/web/public/web_state/ui/crw_web_view_proxy.h"
#import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h" #import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h"
...@@ -193,6 +194,9 @@ const CGFloat kBubblePresentationDelay = 1; ...@@ -193,6 +194,9 @@ const CGFloat kBubblePresentationDelay = 1;
direction:arrowDirection direction:arrowDirection
alignment:BubbleAlignmentTrailing alignment:BubbleAlignmentTrailing
text:text text:text
voiceOverAnnouncement:
l10n_util::GetNSString(
IDS_IOS_LONG_PRESS_TOOLBAR_IPH_PROMOTION_VOICE_OVER)
anchorPoint:searchButtonAnchor]; anchorPoint:searchButtonAnchor];
if (!presenter) if (!presenter)
return; return;
...@@ -207,6 +211,7 @@ presentBubbleForFeature:(const base::Feature&)feature ...@@ -207,6 +211,7 @@ presentBubbleForFeature:(const base::Feature&)feature
direction:(BubbleArrowDirection)direction direction:(BubbleArrowDirection)direction
alignment:(BubbleAlignment)alignment alignment:(BubbleAlignment)alignment
text:(NSString*)text text:(NSString*)text
voiceOverAnnouncement:(NSString*)voiceOverAnnouncement
anchorPoint:(CGPoint)anchorPoint { anchorPoint:(CGPoint)anchorPoint {
BubbleViewControllerPresenter* presenter = BubbleViewControllerPresenter* presenter =
[self bubblePresenterForFeature:feature [self bubblePresenterForFeature:feature
...@@ -214,6 +219,8 @@ presentBubbleForFeature:(const base::Feature&)feature ...@@ -214,6 +219,8 @@ presentBubbleForFeature:(const base::Feature&)feature
alignment:alignment alignment:alignment
text:text]; text:text];
presenter.voiceOverAnnouncement = voiceOverAnnouncement;
[presenter presentInViewController:self.rootViewController [presenter presentInViewController:self.rootViewController
view:self.rootViewController.view view:self.rootViewController.view
anchorPoint:anchorPoint]; anchorPoint:anchorPoint];
...@@ -244,6 +251,9 @@ presentBubbleForFeature:(const base::Feature&)feature ...@@ -244,6 +251,9 @@ presentBubbleForFeature:(const base::Feature&)feature
direction:arrowDirection direction:arrowDirection
alignment:BubbleAlignmentCenter alignment:BubbleAlignmentCenter
text:text text:text
voiceOverAnnouncement:
l10n_util::GetNSString(
IDS_IOS_BOTTOM_TOOLBAR_IPH_PROMOTION_VOICE_OVER)
anchorPoint:searchButtonAnchor]; anchorPoint:searchButtonAnchor];
if (!presenter) if (!presenter)
return; return;
...@@ -290,6 +300,7 @@ presentBubbleForFeature:(const base::Feature&)feature ...@@ -290,6 +300,7 @@ presentBubbleForFeature:(const base::Feature&)feature
direction:arrowDirection direction:arrowDirection
alignment:BubbleAlignmentTrailing alignment:BubbleAlignmentTrailing
text:text text:text
voiceOverAnnouncement:nil
anchorPoint:tabSwitcherAnchor]; anchorPoint:tabSwitcherAnchor];
if (!presenter) if (!presenter)
return; return;
...@@ -321,6 +332,7 @@ presentBubbleForFeature:(const base::Feature&)feature ...@@ -321,6 +332,7 @@ presentBubbleForFeature:(const base::Feature&)feature
direction:arrowDirection direction:arrowDirection
alignment:BubbleAlignmentTrailing alignment:BubbleAlignmentTrailing
text:text text:text
voiceOverAnnouncement:nil
anchorPoint:toolsButtonAnchor]; anchorPoint:toolsButtonAnchor];
if (!presenter) if (!presenter)
return; return;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
// triggered the follow-up action. // triggered the follow-up action.
@property(nonatomic, assign) BOOL triggerFollowUpAction; @property(nonatomic, assign) BOOL triggerFollowUpAction;
// Text to be announced with Voice Over when the bubble is presented.
@property(nonatomic, copy) NSString* voiceOverAnnouncement;
// Initializes the presenter. |text| is the text displayed by the bubble. // Initializes the presenter. |text| is the text displayed by the bubble.
// |arrowDirection| is the direction the bubble's arrow is pointing. |alignment| // |arrowDirection| is the direction the bubble's arrow is pointing. |alignment|
// is the position of the arrow on the bubble. |dismissalCallback| is a block // is the position of the arrow on the bubble. |dismissalCallback| is a block
......
...@@ -104,6 +104,7 @@ void LogBubbleDismissalReason(BubbleDismissalReason reason) { ...@@ -104,6 +104,7 @@ void LogBubbleDismissalReason(BubbleDismissalReason reason) {
@synthesize arrowDirection = _arrowDirection; @synthesize arrowDirection = _arrowDirection;
@synthesize alignment = _alignment; @synthesize alignment = _alignment;
@synthesize dismissalCallback = _dismissalCallback; @synthesize dismissalCallback = _dismissalCallback;
@synthesize voiceOverAnnouncement = _voiceOverAnnouncement;
- (instancetype)initWithText:(NSString*)text - (instancetype)initWithText:(NSString*)text
arrowDirection:(BubbleArrowDirection)arrowDirection arrowDirection:(BubbleArrowDirection)arrowDirection
...@@ -180,6 +181,11 @@ void LogBubbleDismissalReason(BubbleDismissalReason reason) { ...@@ -180,6 +181,11 @@ void LogBubbleDismissalReason(BubbleDismissalReason reason) {
selector:@selector(engagementTimerFired:) selector:@selector(engagementTimerFired:)
userInfo:nil userInfo:nil
repeats:NO]; repeats:NO];
if (self.voiceOverAnnouncement) {
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification,
self.voiceOverAnnouncement);
}
} }
- (void)dismissAnimated:(BOOL)animated { - (void)dismissAnimated:(BOOL)animated {
......
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