Commit 3ab563b3 authored by edchin's avatar edchin Committed by Commit Bot

[iOS] Add hover pointer support for User signin

iOS 13.4 introduces new APIs for mouse cursor support on iPad.

Buttons should react to pointer hover. This CL enables the default
hover effect in the user signin screen.

Test: iPad only. Enable pointer support flag. Ensure buttons respond to pointer in user signin screen.
Bug: 1073961
Change-Id: Ied2f4a4185e5c0346d49059f8c46d6c363e0eda9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2168642Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763446}
parent 69104663
...@@ -19,6 +19,7 @@ source_set("user_signin") { ...@@ -19,6 +19,7 @@ source_set("user_signin") {
"user_signin_view_controller.mm", "user_signin_view_controller.mm",
] ]
deps = [ deps = [
"//base",
"//components/consent_auditor", "//components/consent_auditor",
"//components/sync/base", "//components/sync/base",
"//components/unified_consent", "//components/unified_consent",
...@@ -26,6 +27,7 @@ source_set("user_signin") { ...@@ -26,6 +27,7 @@ source_set("user_signin") {
"//ios/chrome/browser/main:public", "//ios/chrome/browser/main:public",
"//ios/chrome/browser/signin", "//ios/chrome/browser/signin",
"//ios/chrome/browser/sync", "//ios/chrome/browser/sync",
"//ios/chrome/browser/ui:feature_flags",
"//ios/chrome/browser/ui/authentication", "//ios/chrome/browser/ui/authentication",
"//ios/chrome/browser/ui/authentication/signin:signin_headers", "//ios/chrome/browser/ui/authentication/signin:signin_headers",
"//ios/chrome/browser/ui/authentication/signin:signin_protected", "//ios/chrome/browser/ui/authentication/signin:signin_protected",
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
#import "ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_view_controller.h" #import "ios/chrome/browser/ui/authentication/signin/user_signin/user_signin_view_controller.h"
#include "base/feature_list.h"
#import "base/logging.h" #import "base/logging.h"
#import "ios/chrome/browser/ui/authentication/signin/signin_constants.h" #import "ios/chrome/browser/ui/authentication/signin/signin_constants.h"
#import "ios/chrome/browser/ui/authentication/signin/user_signin/gradient_view.h" #import "ios/chrome/browser/ui/authentication/signin/user_signin/gradient_view.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/browser/ui/util/rtl_geometry.h" #import "ios/chrome/browser/ui/util/rtl_geometry.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
...@@ -406,6 +408,13 @@ enum AuthenticationButtonType { ...@@ -406,6 +408,13 @@ enum AuthenticationButtonType {
DCHECK(self.unifiedConsentViewController); DCHECK(self.unifiedConsentViewController);
self.confirmationButton = [[UIButton alloc] init]; self.confirmationButton = [[UIButton alloc] init];
self.confirmationButton.accessibilityIdentifier = @"ic_close"; self.confirmationButton.accessibilityIdentifier = @"ic_close";
#if defined(__IPHONE_13_4)
if (@available(iOS 13.4, *)) {
if (base::FeatureList::IsEnabled(kPointerSupport)) {
self.confirmationButton.pointerInteractionEnabled = YES;
}
}
#endif // defined(__IPHONE_13_4)
[self addSubviewWithButton:self.confirmationButton]; [self addSubviewWithButton:self.confirmationButton];
// Note that the button style will depend on the user sign-in state. // Note that the button style will depend on the user sign-in state.
...@@ -426,6 +435,13 @@ enum AuthenticationButtonType { ...@@ -426,6 +435,13 @@ enum AuthenticationButtonType {
[self.skipSigninButton addTarget:self [self.skipSigninButton addTarget:self
action:@selector(onSkipSigninButtonPressed:) action:@selector(onSkipSigninButtonPressed:)
forControlEvents:UIControlEventTouchUpInside]; forControlEvents:UIControlEventTouchUpInside];
#if defined(__IPHONE_13_4)
if (@available(iOS 13.4, *)) {
if (base::FeatureList::IsEnabled(kPointerSupport)) {
self.skipSigninButton.pointerInteractionEnabled = YES;
}
}
#endif // defined(__IPHONE_13_4)
} }
// Sets up button properties and adds it to view. // Sets up button properties and adds it to view.
......
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