Title: [182049] trunk/Source/WebKit2
- Revision
- 182049
- Author
- [email protected]
- Date
- 2015-03-26 19:24:55 -0700 (Thu, 26 Mar 2015)
Log Message
iOS file upload panel menu items need icons
<https://bugs.webkit.org/show_bug.cgi?id=143042>
<rdar://problem/20178678>
Reviewed by Andy Estes.
* Platform/spi/ios/UIKitSPI.h:
Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
_UIImageGetWebKitPhotoLibraryIcon().
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(photoLibraryIcon):
(cameraIcon):
If UIKit SPI exists, use it. Otherwise, return nil.
(-[WKFileUploadPanel _showDocumentPickerMenu]):
Use icons.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (182048 => 182049)
--- trunk/Source/WebKit2/ChangeLog 2015-03-27 01:53:07 UTC (rev 182048)
+++ trunk/Source/WebKit2/ChangeLog 2015-03-27 02:24:55 UTC (rev 182049)
@@ -1,3 +1,23 @@
+2015-03-25 Jon Honeycutt <[email protected]>
+
+ iOS file upload panel menu items need icons
+ <https://bugs.webkit.org/show_bug.cgi?id=143042>
+ <rdar://problem/20178678>
+
+ Reviewed by Andy Estes.
+
+ * Platform/spi/ios/UIKitSPI.h:
+ Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
+ _UIImageGetWebKitPhotoLibraryIcon().
+
+ * UIProcess/ios/forms/WKFileUploadPanel.mm:
+ (photoLibraryIcon):
+ (cameraIcon):
+ If UIKit SPI exists, use it. Otherwise, return nil.
+
+ (-[WKFileUploadPanel _showDocumentPickerMenu]):
+ Use icons.
+
2015-03-26 Enrica Casucci <[email protected]>
OS X build fix after r182037.
Modified: trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (182048 => 182049)
--- trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h 2015-03-27 01:53:07 UTC (rev 182048)
+++ trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h 2015-03-27 02:24:55 UTC (rev 182049)
@@ -37,6 +37,7 @@
#import <UIKit/UIGestureRecognizer_Private.h>
#import <UIKit/UIImagePickerController_Private.h>
#import <UIKit/UIImage_Private.h>
+#import <UIKit/UIInterface_Private.h>
#import <UIKit/UIKeyboardImpl.h>
#import <UIKit/UIKeyboardIntl.h>
#import <UIKit/UIKeyboard_Private.h>
@@ -699,6 +700,9 @@
void UIImageDataWriteToSavedPhotosAlbum(NSData *imageData, id completionTarget, SEL completionSelector, void *contextInfo);
+UIImage* _UIImageGetWebKitPhotoLibraryIcon(void);
+UIImage* _UIImageGetWebKitTakePhotoOrVideoIcon(void);
+
extern const float UIWebViewGrowsAndShrinksToFitHeight;
extern const float UIWebViewScalesToFitScale;
extern const float UIWebViewStandardViewportWidth;
Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm (182048 => 182049)
--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm 2015-03-27 01:53:07 UTC (rev 182048)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm 2015-03-27 02:24:55 UTC (rev 182049)
@@ -57,6 +57,28 @@
SOFT_LINK_CONSTANT(CoreMedia, kCMTimeZero, CMTime);
#define kCMTimeZero getkCMTimeZero()
+#pragma mark - Document picker icons
+
+static inline UIImage *photoLibraryIcon()
+{
+ // FIXME: Remove when a new SDK is available. <rdar://problem/20150072>
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000 && defined(HAVE_WEBKIT_DOC_PICKER_ICONS)
+ return _UIImageGetWebKitPhotoLibraryIcon();
+#else
+ return nil;
+#endif
+}
+
+static inline UIImage *cameraIcon()
+{
+ // FIXME: Remove when a new SDK is available. <rdar://problem/20150072>
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000 && defined(HAVE_WEBKIT_DOC_PICKER_ICONS)
+ return _UIImageGetWebKitTakePhotoOrVideoIcon();
+#else
+ return nil;
+#endif
+}
+
#pragma mark - Icon generation
static CGRect squareCropRectForSize(CGSize size)
@@ -491,13 +513,12 @@
[_documentMenuController initWithDocumentTypes:[self _documentPickerMenuMediaTypes] inMode:UIDocumentPickerModeImport];
[_documentMenuController setDelegate:self];
- // FIXME: Need icons for Camera and Photo Library options.
- [_documentMenuController addOptionWithTitle:[self _photoLibraryButtonLabel] image:nil order:UIDocumentMenuOrderFirst handler:^{
+ [_documentMenuController addOptionWithTitle:[self _photoLibraryButtonLabel] image:photoLibraryIcon() order:UIDocumentMenuOrderFirst handler:^{
[self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}];
if (NSString *cameraString = [self _cameraButtonLabel]) {
- [_documentMenuController addOptionWithTitle:cameraString image:nil order:UIDocumentMenuOrderFirst handler:^{
+ [_documentMenuController addOptionWithTitle:cameraString image:cameraIcon() order:UIDocumentMenuOrderFirst handler:^{
_usingCamera = YES;
[self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypeCamera];
}];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes