Title: [175121] branches/safari-600.3-branch/Source/WebKit2

Diff

Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (175120 => 175121)


--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-10-23 15:52:45 UTC (rev 175120)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-10-23 15:56:41 UTC (rev 175121)
@@ -1,5 +1,21 @@
 2014-10-23  Matthew Hanson  <[email protected]>
 
+        Merge r174913. <rdar://problem/18712808>
+
+    2014-10-20  Beth Dakin  <[email protected]>
+    
+            Action menu items should have tags
+            https://bugs.webkit.org/show_bug.cgi?id=137898
+    
+            Reviewed by Anders Carlsson.
+    
+            * Shared/API/c/WKActionMenuItemTypes.h: Added.
+            * UIProcess/API/mac/WKView.mm:
+            (-[WKView _defaultMenuItemsForLink]):
+            * WebKit2.xcodeproj/project.pbxproj:
+    
+2014-10-23  Matthew Hanson  <[email protected]>
+
         Merge r175061. <rdar://problem/18694470>
 
     2014-10-22  Beth Dakin  <[email protected]>

Copied: branches/safari-600.3-branch/Source/WebKit2/Shared/API/c/WKActionMenuItemTypes.h (from rev 174913, trunk/Source/WebKit2/Shared/API/c/WKActionMenuItemTypes.h) (0 => 175121)


--- branches/safari-600.3-branch/Source/WebKit2/Shared/API/c/WKActionMenuItemTypes.h	                        (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/API/c/WKActionMenuItemTypes.h	2014-10-23 15:56:41 UTC (rev 175121)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKActionMenuItemTypes_h
+#define WKActionMenuItemTypes_h
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+    kWKContextActionItemTagNoAction = 0,
+    kWKContextActionItemTagOpenLinkInDefaultBrowser,
+    kWKContextActionItemTagPreviewLink,
+    kWKContextActionItemTagAddLinkToSafariReadingList
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKActionMenuItemTypes_h */

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (175120 => 175121)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-10-23 15:52:45 UTC (rev 175120)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-10-23 15:56:41 UTC (rev 175121)
@@ -56,6 +56,7 @@
 #import "ViewGestureController.h"
 #import "ViewSnapshotStore.h"
 #import "WKAPICast.h"
+#import "WKActionMenuItemTypes.h"
 #import "WKFullScreenWindowController.h"
 #import "WKPrintingView.h"
 #import "WKProcessPoolInternal.h"
@@ -3680,16 +3681,19 @@
     RetainPtr<NSMenuItem> openLinkItem = adoptNS([[NSMenuItem alloc] initWithTitle:@"Open" action:@selector(_openURLFromActionMenu:) keyEquivalent:@""]);
     [openLinkItem setImage:[[NSBundle bundleForClass:[WKView class]] imageForResource:@"OpenInNewWindowTemplate"]];
     [openLinkItem setTarget:self];
+    [openLinkItem setTag:kWKContextActionItemTagOpenLinkInDefaultBrowser];
     [menuItems addObject:openLinkItem.get()];
 
     RetainPtr<NSMenuItem> previewLinkItem = adoptNS([[NSMenuItem alloc] initWithTitle:@"Preview" action:@selector(_quickLookURLFromActionMenu:) keyEquivalent:@""]);
     [previewLinkItem setImage:[NSImage imageNamed:NSImageNameQuickLookTemplate]];
     [previewLinkItem setTarget:self];
+    [previewLinkItem setTag:kWKContextActionItemTagPreviewLink];
     [menuItems addObject:previewLinkItem.get()];
 
     RetainPtr<NSMenuItem> readingListItem = adoptNS([[NSMenuItem alloc] initWithTitle:@"Add to Safari Reading List" action:@selector(_addToReadingListFromActionMenu:) keyEquivalent:@""]);
     [readingListItem setImage:[NSImage imageNamed:NSImageNameBookmarksTemplate]];
     [readingListItem setTarget:self];
+    [readingListItem setTag:kWKContextActionItemTagAddLinkToSafariReadingList];
     [menuItems addObject:readingListItem.get()];
 
     // FIXME: Required to work around <rdar://18684207>.

Modified: branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (175120 => 175121)


--- branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-10-23 15:52:45 UTC (rev 175120)
+++ branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-10-23 15:56:41 UTC (rev 175121)
@@ -1088,6 +1088,7 @@
 		909854ED12BC4E18000AD080 /* WebMemorySampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 905620E912BC248B000799B6 /* WebMemorySampler.h */; };
 		909854EE12BC4E18000AD080 /* WebMemorySampler.mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 905620E512BC2476000799B6 /* WebMemorySampler.mac.mm */; };
 		9348427D19F19BD10009D5AE /* OpenInNewWindowTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 9348427C19F19BD00009D5AE /* OpenInNewWindowTemplate.pdf */; };
+		934B724419F5B9BE00AE96D6 /* WKActionMenuItemTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 934B724319F5B9BE00AE96D6 /* WKActionMenuItemTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935EEB951277616D003322B8 /* WKBundleBackForwardList.cpp */; };
 		935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB961277616D003322B8 /* WKBundleBackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3147,6 +3148,7 @@
 		905620E812BC248B000799B6 /* WebMemorySampler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMemorySampler.cpp; sourceTree = "<group>"; };
 		905620E912BC248B000799B6 /* WebMemorySampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMemorySampler.h; sourceTree = "<group>"; };
 		9348427C19F19BD00009D5AE /* OpenInNewWindowTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = OpenInNewWindowTemplate.pdf; path = Resources/OpenInNewWindowTemplate.pdf; sourceTree = "<group>"; };
+		934B724319F5B9BE00AE96D6 /* WKActionMenuItemTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKActionMenuItemTypes.h; sourceTree = "<group>"; };
 		935EEB8F1277615D003322B8 /* InjectedBundleBackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBackForwardList.cpp; sourceTree = "<group>"; };
 		935EEB901277615D003322B8 /* InjectedBundleBackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleBackForwardList.h; sourceTree = "<group>"; };
 		935EEB911277615D003322B8 /* InjectedBundleBackForwardListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBackForwardListItem.cpp; sourceTree = "<group>"; };
@@ -6675,6 +6677,7 @@
 				BC4075D5124FEFFA0068F20A /* cf */,
 				BCCF6AC412C91F3B008F9C35 /* cg */,
 				BC4075D6124FF0000068F20A /* mac */,
+				934B724319F5B9BE00AE96D6 /* WKActionMenuItemTypes.h */,
 				BC4075D7124FF0270068F20A /* WKArray.cpp */,
 				BC4075D8124FF0270068F20A /* WKArray.h */,
 				BCDDB316124EBD130048D13C /* WKBase.h */,
@@ -7268,6 +7271,7 @@
 				5179556E162877B300FA43B6 /* NetworkProcessProxy.h in Headers */,
 				513A163D163088F6005D7D22 /* NetworkProcessProxyMessages.h in Headers */,
 				BCF4DE23168E4BD500C94AFC /* NetworkProcessSupplement.h in Headers */,
+				934B724419F5B9BE00AE96D6 /* WKActionMenuItemTypes.h in Headers */,
 				51FD18B61651FBAD00DBE1CE /* NetworkResourceLoader.h in Headers */,
 				E152551B17011819003D7ADB /* NetworkResourceLoaderMessages.h in Headers */,
 				51CBBA10165219B6005BE8FD /* NetworkResourceLoadParameters.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to