Skip to content

Commit

Permalink
Reland "[ios] Reduce pointer boilerplate in Credential Provider"
Browse files Browse the repository at this point in the history
This reverts commit 525a4a2.

Reason for revert:

Fixed missing @EnD

Original change's description:
> Revert "[ios] Reduce pointer boilerplate in Credential Provider"
>
> This reverts commit ca2e472.
>
> Reason for revert: breaks compile, see https://ci.chromium.org/p/chromium/builders/ci/ios-simulator-noncq/4247?
>
> Original change's description:
> > [ios] Reduce pointer boilerplate in Credential Provider
> >
> > crrev.com/c/2199891 introduces a reusable class for pointer
> > interactions for non-button views. This class internally handles
> > all the delegate callbacks. So usage is simplified to a single line.
> >
> > This CL should have no impact/change on the UI.
> >
> > Bug: 1073961
> > Change-Id: I28904804916d0c112f73fe6e372bea6aede504d0
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2199727
> > Reviewed-by: Javier Ernesto Flores Robles <javierrobles@chromium.org>
> > Commit-Queue: edchin <edchin@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#768924}
>
> TBR=edchin@chromium.org,javierrobles@chromium.org
>
> Change-Id: Ib4e9c99203d3dbb673d49f302b342d2055561b3d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1073961
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2203138
> Reviewed-by: Dana Fried <dfried@google.com>
> Commit-Queue: Dana Fried <dfried@google.com>
> Cr-Commit-Position: refs/heads/master@{#768987}

TBR=edchin@chromium.org,javierrobles@chromium.org,dfried@google.com

# Not skipping CQ checks because this is a reland.

TBR=javierrobles@chromium.org

Bug: 1073961
Change-Id: I8534dd58ff1f7ba9f2ad2567bea894ed200b8597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202687
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769056}
  • Loading branch information
edx246 authored and Commit Bot committed May 14, 2020
1 parent a161085 commit 1e0897d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
1 change: 1 addition & 0 deletions ios/chrome/credential_provider_extension/ui/BUILD.gn
Expand Up @@ -33,6 +33,7 @@ source_set("ui") {
"//ios/chrome/common/credential_provider:ui",
"//ios/chrome/common/ui/colors",
"//ios/chrome/common/ui/confirmation_alert",
"//ios/chrome/common/ui/util",
"//ios/chrome/credential_provider_extension:metrics_util",
"//ios/chrome/credential_provider_extension:password_util",
"//ios/chrome/credential_provider_extension:reauthentication_handler",
Expand Down
Expand Up @@ -8,6 +8,7 @@
#include "ios/chrome/common/app_group/app_group_metrics.h"
#import "ios/chrome/common/credential_provider/credential.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/util/pointer_interaction_util.h"
#import "ios/chrome/credential_provider_extension/metrics_util.h"

#if !defined(__has_feature) || !__has_feature(objc_arc)
Expand All @@ -24,7 +25,7 @@

#if defined(__IPHONE_13_4)
// This cell just adds a simple hover pointer interaction to the TableViewCell.
@interface CredentialListCell : UITableViewCell <UIPointerInteractionDelegate>
@interface CredentialListCell : UITableViewCell
@end

@implementation CredentialListCell
Expand All @@ -34,32 +35,12 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
if (@available(iOS 13.4, *)) {
[self
addInteraction:[[UIPointerInteraction alloc] initWithDelegate:self]];
[self addInteraction:[[ViewPointerInteraction alloc] init]];
}
}
return self;
}

#pragma mark UIPointerInteractionDelegate

- (UIPointerRegion*)pointerInteraction:(UIPointerInteraction*)interaction
regionForRequest:(UIPointerRegionRequest*)request
defaultRegion:(UIPointerRegion*)defaultRegion
API_AVAILABLE(ios(13.4)) {
return defaultRegion;
}

- (UIPointerStyle*)pointerInteraction:(UIPointerInteraction*)interaction
styleForRegion:(UIPointerRegion*)region
API_AVAILABLE(ios(13.4)) {
UIPointerHoverEffect* effect = [UIPointerHoverEffect
effectWithPreview:[[UITargetedPreview alloc] initWithView:self]];
effect.prefersScaledContent = NO;
effect.prefersShadow = NO;
return [UIPointerStyle styleWithEffect:effect shape:nil];
}

@end
#endif // defined(__IPHONE_13_4)

Expand Down

0 comments on commit 1e0897d

Please sign in to comment.