Title: [210488] trunk/Tools
Revision
210488
Author
[email protected]
Date
2017-01-07 13:15:55 -0800 (Sat, 07 Jan 2017)

Log Message

Make it possible to drop HTML files on the MiniBrowser icon
https://bugs.webkit.org/show_bug.cgi?id=166802

Reviewed by Simon Fraser.

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate application:openFile:]):
* MiniBrowser/mac/Info.plist:
If you're using an editable window, the usual trick of dropping on the
window doesn't work anymore (it makes an <attachment> instead).

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (210487 => 210488)


--- trunk/Tools/ChangeLog	2017-01-07 21:13:10 UTC (rev 210487)
+++ trunk/Tools/ChangeLog	2017-01-07 21:15:55 UTC (rev 210488)
@@ -1,5 +1,18 @@
 2017-01-07  Tim Horton  <[email protected]>
 
+        Make it possible to drop HTML files on the MiniBrowser icon
+        https://bugs.webkit.org/show_bug.cgi?id=166802
+
+        Reviewed by Simon Fraser.
+
+        * MiniBrowser/mac/AppDelegate.m:
+        (-[BrowserAppDelegate application:openFile:]):
+        * MiniBrowser/mac/Info.plist:
+        If you're using an editable window, the usual trick of dropping on the
+        window doesn't work anymore (it makes an <attachment> instead).
+
+2017-01-07  Tim Horton  <[email protected]>
+
         MiniBrowser window gets smaller each time it is instantiated
         https://bugs.webkit.org/show_bug.cgi?id=166807
 

Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.m (210487 => 210488)


--- trunk/Tools/MiniBrowser/mac/AppDelegate.m	2017-01-07 21:13:10 UTC (rev 210487)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.m	2017-01-07 21:15:55 UTC (rev 210488)
@@ -221,6 +221,17 @@
     return nil;
 }
 
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+    BrowserWindowController *controller = [self createBrowserWindowController:nil];
+    if (!controller)
+        return NO;
+
+    [controller.window makeKeyAndOrderFront:self];
+    [controller loadURLString:[NSURL fileURLWithPath:filename].absoluteString];
+    return YES;
+}
+
 - (IBAction)openDocument:(id)sender
 {
     BrowserWindowController *browserWindowController = [self frontmostBrowserWindowController];

Modified: trunk/Tools/MiniBrowser/mac/Info.plist (210487 => 210488)


--- trunk/Tools/MiniBrowser/mac/Info.plist	2017-01-07 21:13:10 UTC (rev 210487)
+++ trunk/Tools/MiniBrowser/mac/Info.plist	2017-01-07 21:15:55 UTC (rev 210488)
@@ -35,5 +35,22 @@
 	</dict>
 	<key>NSSupportsAutomaticGraphicsSwitching</key>
 	<true/>
+	<key>CFBundleDocumentTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>html</string>
+			</array>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>text/html</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>HTML</string>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+		</dict>
+	</array>
 </dict>
 </plist>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to