Title: [191407] trunk/Source/WebKit2
- Revision
- 191407
- Author
- ander...@apple.com
- Date
- 2015-10-21 15:17:03 -0700 (Wed, 21 Oct 2015)
Log Message
WebContextMenuProxyMac::setupServicesMenu doesn't need to take a context parameter
https://bugs.webkit.org/show_bug.cgi?id=150418
Reviewed by Tim Horton.
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):
(WebKit::WebContextMenuProxyMac::populate):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (191406 => 191407)
--- trunk/Source/WebKit2/ChangeLog 2015-10-21 22:14:38 UTC (rev 191406)
+++ trunk/Source/WebKit2/ChangeLog 2015-10-21 22:17:03 UTC (rev 191407)
@@ -1,5 +1,17 @@
2015-10-21 Anders Carlsson <ander...@apple.com>
+ WebContextMenuProxyMac::setupServicesMenu doesn't need to take a context parameter
+ https://bugs.webkit.org/show_bug.cgi?id=150418
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/mac/WebContextMenuProxyMac.h:
+ * UIProcess/mac/WebContextMenuProxyMac.mm:
+ (WebKit::WebContextMenuProxyMac::setupServicesMenu):
+ (WebKit::WebContextMenuProxyMac::populate):
+
+2015-10-21 Anders Carlsson <ander...@apple.com>
+
WebContextMenuProxy doesn't have to be ref-counted
https://bugs.webkit.org/show_bug.cgi?id=150415
Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h (191406 => 191407)
--- trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h 2015-10-21 22:14:38 UTC (rev 191406)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h 2015-10-21 22:17:03 UTC (rev 191407)
@@ -62,7 +62,7 @@
void populate(const Vector<RefPtr<WebContextMenuItem>>&);
#if ENABLE(SERVICE_CONTROLS)
- void setupServicesMenu(const ContextMenuContextData&);
+ void setupServicesMenu();
WebCore::ContextMenuItem shareMenuItem();
#endif
Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm (191406 => 191407)
--- trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm 2015-10-21 22:14:38 UTC (rev 191406)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm 2015-10-21 22:17:03 UTC (rev 191407)
@@ -248,13 +248,13 @@
}
#if ENABLE(SERVICE_CONTROLS)
-void WebContextMenuProxyMac::setupServicesMenu(const ContextMenuContextData& context)
+void WebContextMenuProxyMac::setupServicesMenu()
{
- bool includeEditorServices = context.controlledDataIsEditable();
- bool hasControlledImage = context.controlledImage();
+ bool includeEditorServices = m_context.controlledDataIsEditable();
+ bool hasControlledImage = m_context.controlledImage();
NSArray *items = nil;
if (hasControlledImage) {
- RefPtr<ShareableBitmap> image = context.controlledImage();
+ RefPtr<ShareableBitmap> image = m_context.controlledImage();
if (!image)
return;
@@ -267,9 +267,9 @@
#else
items = @[ ];
#endif
- } else if (!context.controlledSelectionData().isEmpty()) {
- RetainPtr<NSData> selectionData = adoptNS([[NSData alloc] initWithBytes:(void*)context.controlledSelectionData().data() length:context.controlledSelectionData().size()]);
- RetainPtr<NSAttributedString> selection = adoptNS([[NSAttributedString alloc] initWithRTFD:selectionData.get() documentAttributes:nil]);
+ } else if (!m_context.controlledSelectionData().isEmpty()) {
+ auto selectionData = adoptNS([[NSData alloc] initWithBytes:static_cast<const void*>(m_context.controlledSelectionData().data()) length:m_context.controlledSelectionData().size()]);
+ auto selection = adoptNS([[NSAttributedString alloc] initWithRTFD:selectionData.get() documentAttributes:nil]);
items = @[ selection.get() ];
} else {
@@ -290,9 +290,9 @@
[m_menu setShowsStateColumn:YES];
// Explicitly add a menu item for each telephone number that is in the selection.
- const Vector<String>& selectedTelephoneNumbers = context.selectedTelephoneNumbers();
Vector<RetainPtr<NSMenuItem>> telephoneNumberMenuItems;
- for (auto& telephoneNumber : selectedTelephoneNumbers) {
+
+ for (auto& telephoneNumber : m_context.selectedTelephoneNumbers()) {
if (NSMenuItem *item = menuItemForTelephoneNumber(telephoneNumber)) {
[item setIndentationLevel:1];
telephoneNumberMenuItems.append(item);
@@ -364,7 +364,7 @@
{
#if ENABLE(SERVICE_CONTROLS)
if (m_context.isServicesMenu()) {
- setupServicesMenu(m_context);
+ setupServicesMenu();
return;
}
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes