Changeset 90551 in webkit
- Timestamp:
- Jul 7, 2011 3:29:19 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90549 r90551 1 2011-07-07 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Open links in a new window when clicking with the middle button in MiniBrowser 4 https://bugs.webkit.org/show_bug.cgi?id=63988 5 6 Reviewed by Martin Robinson. 7 8 * MiniBrowser/gtk/BrowserWindow.c: 9 (browserWindowConstructed): 10 (decidePolicyForNavigationAction): Ignore the action if a link is 11 clicked with the middle buttonm and open the link in a new window. 12 (browserWindowPolicyClientInit): 13 1 14 2011-07-07 Adam Barth <abarth@webkit.org> 2 15 -
trunk/Tools/MiniBrowser/gtk/BrowserWindow.c
r90163 r90551 57 57 static void browserWindowLoaderClientInit(BrowserWindow*); 58 58 static void browserWindowUIClientInit(BrowserWindow*); 59 static void browserWindowPolicyClientInit(BrowserWindow*); 59 60 60 61 static gint windowCount = 0; … … 184 185 browserWindowLoaderClientInit(window); 185 186 browserWindowUIClientInit(window); 187 browserWindowPolicyClientInit(window); 186 188 } 187 189 … … 655 657 } 656 658 659 static void decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) 660 { 661 if (navigationType != kWKFrameNavigationTypeLinkClicked || mouseButton != kWKEventMouseButtonMiddleButton) { 662 WKFramePolicyListenerUse(listener); 663 return; 664 } 665 666 WKViewRef webView = WKViewCreate(WKPageGetContext(page), 0); 667 GtkWidget *window = browser_window_new(webView); 668 WKURLRef url = WKURLRequestCopyURL(request); 669 WKPageLoadURL(WKViewGetPage(webView), url); 670 WKRelease(url); 671 gtk_widget_grab_focus(GTK_WIDGET(webView)); 672 gtk_widget_show(window); 673 674 WKFramePolicyListenerIgnore(listener); 675 } 676 677 static void browserWindowPolicyClientInit(BrowserWindow* window) 678 { 679 WKPagePolicyClient policyClient = { 680 kWKPagePolicyClientCurrentVersion, 681 window, /* clientInfo */ 682 decidePolicyForNavigationAction, 683 0, /* decidePolicyForNewWindowAction */ 684 0, /* decidePolicyForResponse */ 685 0 /* unableToImplementPolicy */ 686 }; 687 WKPageSetPagePolicyClient(WKViewGetPage(window->webView), &policyClient); 688 } 689 657 690 // Public API. 658 691 GtkWidget* browser_window_new(WKViewRef view)
Note: See TracChangeset
for help on using the changeset viewer.