Changeset 190102 in webkit
- Timestamp:
- Sep 21, 2015, 9:27:09 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r190099 r190102 1 2015-09-21 Timothy Horton <timothy_horton@apple.com> 2 3 Allow DataDetectors to pre-filter telephone number menu items 4 https://bugs.webkit.org/show_bug.cgi?id=149444 5 <rdar://problem/19286320> 6 7 Reviewed by Sam Weinig. 8 9 * platform/spi/mac/DataDetectorsSPI.h: 10 Add some SPI. 11 1 12 2015-09-21 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h
r187043 r190102 47 47 @property (assign) BOOL altMode; 48 48 @property (assign) BOOL immediate; 49 50 @property (copy) NSArray *allowedActionUTIs; 49 51 50 52 - (DDActionContext *)contextForView:(NSView *)view altMode:(BOOL)altMode interactionStartedHandler:(void (^)(void))interactionStartedHandler interactionChangedHandler:(void (^)(void))interactionChangedHandler interactionStoppedHandler:(void (^)(void))interactionStoppedHandler; -
trunk/Source/WebKit2/ChangeLog
r190095 r190102 1 2015-09-21 Timothy Horton <timothy_horton@apple.com> 2 3 Allow DataDetectors to pre-filter telephone number menu items 4 https://bugs.webkit.org/show_bug.cgi?id=149444 5 <rdar://problem/19286320> 6 7 Reviewed by Sam Weinig. 8 9 * Platform/mac/MenuUtilities.mm: 10 (WebKit::menuItemForTelephoneNumber): 11 (WebKit::menuForTelephoneNumber): 12 Let DataDetectors know what kind of items we want, so that they can avoid 13 some unnecessary work in cases where we were just going to throw away the items anyway. 14 1 15 2015-09-21 Gwang Yoon Hwang <yoon@igalia.com> 2 16 -
trunk/Source/WebKit2/Platform/mac/MenuUtilities.mm
r184058 r190102 51 51 NSMenuItem *menuItemForTelephoneNumber(const String& telephoneNumber) 52 52 { 53 NSArray *proposedMenu = [[getDDActionsManagerClass() sharedManager] menuItemsForValue:(NSString *)telephoneNumber type:getDDBinderPhoneNumberKey() service:nil context:nil]; 54 for (NSMenuItem *item in proposedMenu) { 53 RetainPtr<DDActionContext> actionContext = [[getDDActionContextClass() alloc] init]; 54 [actionContext setAllowedActionUTIs:@[ @"com.apple.dial" ]]; 55 56 NSArray *proposedMenuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForValue:(NSString *)telephoneNumber type:getDDBinderPhoneNumberKey() service:nil context:actionContext.get()]; 57 for (NSMenuItem *item in proposedMenuItems) { 55 58 NSDictionary *representedObject = item.representedObject; 56 59 if (![representedObject isKindOfClass:[NSDictionary class]]) … … 76 79 NSMenuItem *dialItem = nil; 77 80 78 NSArray *proposedMenu = [[getDDActionsManagerClass() sharedManager] menuItemsForValue:(NSString *)telephoneNumber type:getDDBinderPhoneNumberKey() service:nil context:nil]; 79 for (NSMenuItem *item in proposedMenu) { 81 RetainPtr<DDActionContext> actionContext = [[getDDActionContextClass() alloc] init]; 82 [actionContext setAllowedActionUTIs:@[ @"com.apple.dial", @"com.apple.facetime", @"com.apple.facetimeaudio" ]]; 83 84 NSArray *proposedMenuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForValue:(NSString *)telephoneNumber type:getDDBinderPhoneNumberKey() service:nil context:actionContext.get()]; 85 for (NSMenuItem *item in proposedMenuItems) { 80 86 NSDictionary *representedObject = item.representedObject; 81 87 if (![representedObject isKindOfClass:[NSDictionary class]]) … … 86 92 continue; 87 93 88 if ([actionObject.actionUTI hasPrefix:@"com.apple.dial"]) {94 if ([actionObject.actionUTI hasPrefix:@"com.apple.dial"]) 89 95 dialItem = item; 90 continue; 91 } 92 93 if ([actionObject.actionUTI hasPrefix:@"com.apple.facetime"]) 96 else if ([actionObject.actionUTI hasPrefix:@"com.apple.facetime"]) 94 97 [faceTimeItems addObject:item]; 95 98 }
Note:
See TracChangeset
for help on using the changeset viewer.