Changeset 71041 in webkit
- Timestamp:
- Nov 1, 2010 11:34:04 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r71039 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 Add a "showContextMenu" call to Chrome/ChromeClient: 9 * loader/EmptyClients.h: 10 (WebCore::EmptyChromeClient::showContextMenu): 11 * page/Chrome.cpp: 12 (WebCore::Chrome::showContextMenu): 13 * page/Chrome.h: 14 * page/ChromeClient.h: 15 16 Add a "platform description to ContextMenuItem" creator, will be needed by WebKit2 17 * platform/ContextMenu.h: 18 * platform/mac/ContextMenuMac.mm: 19 (WebCore::contextMenuItemVector): 20 21 * platform/mac/ContextMenuItemMac.mm: 22 (WebCore::ContextMenuItem::checked): WebKit2 ports now need this implemented. 23 24 Stub these out to keep their WK2 ports building: 25 * platform/qt/ContextMenuItemQt.cpp: 26 (WebCore::ContextMenuItem::checked): 27 * platform/qt/ContextMenuQt.cpp: 28 (WebCore::contextMenuItemVector): 29 * platform/win/ContextMenuItemWin.cpp: 30 (WebCore::ContextMenuItem::checked): 31 * platform/win/ContextMenuWin.cpp: 32 (WebCore::contextMenuItemVector): 33 1 34 2010-11-01 Eric Carlson <eric.carlson@apple.com> 2 35 -
trunk/WebCore/WebCore.exp.in
r70960 r71041 1226 1226 __ZN7WebCore11ContextMenu22setPlatformDescriptionEP14NSMutableArray 1227 1227 __ZN7WebCore12EventHandler20sendContextMenuEventEP7NSEvent 1228 __ZN7WebCore12EventHandler20sendContextMenuEventERKNS_18PlatformMouseEventE 1228 1229 __ZN7WebCore15ContextMenuItem26releasePlatformDescriptionEv 1230 __ZN7WebCore15ContextMenuItemC1ENS_19ContextMenuItemTypeENS_17ContextMenuActionERKN3WTF6StringEPNS_11ContextMenuE 1231 __ZN7WebCore15ContextMenuItemD1Ev 1229 1232 __ZN7WebCore21ContextMenuController16clearContextMenuEv 1233 __ZN7WebCore21ContextMenuController23contextMenuItemSelectedEPNS_15ContextMenuItemE 1234 __ZN7WebCore21contextMenuItemVectorEP14NSMutableArray 1235 __ZN7WebCore6Chrome15showContextMenuEv 1230 1236 __ZNK7WebCore11ContextMenu19platformDescriptionEv 1237 __ZNK7WebCore11ContextMenu21checkOrEnableIfNeededERNS_15ContextMenuItemE 1238 __ZNK7WebCore15ContextMenuItem15platformSubMenuEv 1239 __ZNK7WebCore15ContextMenuItem4typeEv 1240 __ZNK7WebCore15ContextMenuItem5titleEv 1241 __ZNK7WebCore15ContextMenuItem6actionEv 1242 __ZNK7WebCore15ContextMenuItem7checkedEv 1243 __ZNK7WebCore15ContextMenuItem7enabledEv 1231 1244 #endif 1232 1245 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r71035 r71041 21299 21299 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 21300 21300 compatibilityVersion = "Xcode 2.4"; 21301 developmentRegion = English; 21301 21302 hasScannedForEncodings = 1; 21302 21303 knownRegions = ( -
trunk/WebCore/loader/EmptyClients.h
r70894 r71041 140 140 virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const { return adoptRef(new EmptySearchPopupMenu()); } 141 141 142 #if ENABLE(CONTEXT_MENUS) 143 virtual void showContextMenu() { } 144 #endif 145 142 146 virtual void setStatusbarText(const String&) { } 143 147 -
trunk/WebCore/page/Chrome.cpp
r70333 r71041 503 503 } 504 504 505 #if ENABLE(CONTEXT_MENUS) 506 void Chrome::showContextMenu() 507 { 508 m_client->showContextMenu(); 509 } 510 #endif 511 505 512 } // namespace WebCore -
trunk/WebCore/page/Chrome.h
r70333 r71041 156 156 PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; 157 157 158 #if ENABLE(CONTEXT_MENUS) 159 void showContextMenu(); 160 #endif 161 158 162 private: 159 163 Page* m_page; -
trunk/WebCore/page/ChromeClient.h
r70333 r71041 270 270 virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const = 0; 271 271 272 #if ENABLE(CONTEXT_MENUS) 273 virtual void showContextMenu() = 0; 274 #endif 275 272 276 virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) { } 273 277 -
trunk/WebCore/platform/ContextMenu.h
r60454 r71041 92 92 }; 93 93 94 Vector<ContextMenuItem> contextMenuItemVector(PlatformMenuDescription); 95 94 96 } 95 97 -
trunk/WebCore/platform/mac/ContextMenuItemMac.mm
r48429 r71041 155 155 } 156 156 157 bool ContextMenuItem::checked() const 158 { 159 return [m_platformDescription.get() state] == NSOnState; 160 } 161 157 162 } // namespace WebCore 158 163 -
trunk/WebCore/platform/mac/ContextMenuMac.mm
r48429 r71041 154 154 } 155 155 156 Vector<ContextMenuItem> contextMenuItemVector(PlatformMenuDescription menu) 157 { 158 Vector<ContextMenuItem> items; 159 unsigned count = [menu count]; 160 if (menu) 161 items.reserveCapacity(count); 162 163 for (unsigned i = 0; i < count; ++i) 164 items.append(ContextMenuItem([menu objectAtIndex:i])); 165 166 return items; 167 } 168 156 169 } // namespace WebCore 157 170 -
trunk/WebCore/platform/qt/ContextMenuItemQt.cpp
r60751 r71041 105 105 } 106 106 107 bool ContextMenuItem::checked() const 108 { 109 // FIXME - Implement 110 return false; 111 } 112 107 113 void ContextMenuItem::setEnabled(bool on) 108 114 { -
trunk/WebCore/platform/qt/ContextMenuQt.cpp
r60750 r71041 75 75 } 76 76 77 Vector<ContextMenuItem> contextMenuItemVector(PlatformMenuDescription) 78 { 79 // FIXME - Implement 80 return Vector<ContextMenuItem>(); 81 } 77 82 78 83 } -
trunk/WebCore/platform/win/ContextMenuItemWin.cpp
r70812 r71041 185 185 } 186 186 187 bool ContextMenuItem::checked() const 188 { 189 // FIXME - Implement 190 return false; 191 } 192 187 193 void ContextMenuItem::setEnabled(bool enabled) 188 194 { -
trunk/WebCore/platform/win/ContextMenuWin.cpp
r56825 r71041 156 156 } 157 157 158 Vector<ContextMenuItem> contextMenuItemVector(PlatformMenuDescription) 159 { 160 // FIXME - Implement 161 return Vector<ContextMenuItem>(); 158 162 } 163 164 } -
trunk/WebKit/chromium/ChangeLog
r71040 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * src/ChromeClientImpl.h: 9 (WebKit::ChromeClientImpl::showContextMenu): 10 1 11 2010-11-01 Pavel Feldman <pfeldman@chromium.org> 2 12 -
trunk/WebKit/chromium/src/ChromeClientImpl.h
r70333 r71041 175 175 virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; 176 176 177 #if ENABLE(CONTEXT_MENUS) 178 virtual void showContextMenu() { } 179 #endif 180 177 181 private: 178 182 void getPopupMenuInfo(WebCore::PopupContainer*, WebPopupMenuInfo*); -
trunk/WebKit/efl/ChangeLog
r70976 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebCoreSupport/ChromeClientEfl.h: 9 (WebCore::ChromeClientEfl::showContextMenu): 10 1 11 2010-10-29 Daniel Bates <dbates@rim.com> 2 12 -
trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
r70333 r71041 116 116 #endif 117 117 118 #if ENABLE(CONTEXT_MENUS) 119 virtual void showContextMenu() { } 120 #endif 121 118 122 virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); 119 123 virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); -
trunk/WebKit/gtk/ChangeLog
r71031 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebCoreSupport/ChromeClientGtk.h: 9 (WebKit::ChromeClient::showContextMenu): 10 1 11 2010-11-01 Martin Robinson <mrobinson@igalia.com> 2 12 -
trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
r70333 r71041 118 118 virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*); 119 119 #endif 120 #if ENABLE(CONTEXT_MENUS) 121 virtual void showContextMenu() { } 122 #endif 120 123 virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); 121 124 virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); -
trunk/WebKit/haiku/ChangeLog
r70894 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebCoreSupport/ChromeClientHaiku.h: 9 (WebCore::ChromeClientHaiku::showContextMenu): 10 1 11 2010-10-29 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
r70333 r71041 138 138 virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); 139 139 #endif 140 #if ENABLE(CONTEXT_MENUS) 141 virtual void showContextMenu() { } 142 #endif 140 143 141 144 // This is an asynchronous call. The ChromeClient can display UI asking the user for permission -
trunk/WebKit/mac/ChangeLog
r70976 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebCoreSupport/WebChromeClient.h: 9 (WebChromeClient::showContextMenu): 10 1 11 2010-10-29 Daniel Bates <dbates@rim.com> 2 12 -
trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h
r70333 r71041 179 179 virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; 180 180 181 #if ENABLE(CONTEXT_MENUS) 182 virtual void showContextMenu() { } 183 #endif 181 184 private: 182 185 WebView *m_webView; -
trunk/WebKit/qt/ChangeLog
r71004 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebCoreSupport/ChromeClientQt.h: 9 (WebCore::ChromeClientQt::showContextMenu): 10 1 11 2010-10-31 Robert Hogan <robert@webkit.org> 2 12 -
trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h
r70333 r71041 135 135 virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); 136 136 #endif 137 #if ENABLE(CONTEXT_MENUS) 138 virtual void showContextMenu() { } 139 #endif 137 140 138 141 #if ENABLE(NOTIFICATIONS) -
trunk/WebKit/win/ChangeLog
r71032 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebCoreSupport/WebChromeClient.h: 9 (WebChromeClient::showContextMenu): 10 1 11 2010-11-01 Adam Roben <aroben@apple.com> 2 12 -
trunk/WebKit/win/WebCoreSupport/WebChromeClient.h
r70341 r71041 123 123 #endif 124 124 125 #if ENABLE(CONTEXT_MENUS) 126 virtual void showContextMenu() { } 127 #endif 128 125 129 virtual void populateVisitedLinks(); 126 130 -
trunk/WebKit/wx/ChangeLog
r70931 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebKitSupport/ChromeClientWx.h: 9 (WebCore::ChromeClientWx::showContextMenu): 10 1 11 2010-10-29 Darin Adler <darin@apple.com> 2 12 -
trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h
r70333 r71041 130 130 #endif 131 131 132 #if ENABLE(CONTEXT_MENUS) 133 virtual void showContextMenu() { } 134 #endif 135 132 136 virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); 133 137 virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); -
trunk/WebKit2/ChangeLog
r71033 r71041 1 2010-11-01 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 6 Context menu support for WebKit 2. 7 8 * WebKit2.pro: 9 * WebKit2.xcodeproj/project.pbxproj: 10 * win/WebKit2.vcproj: 11 12 * Shared/WebContextMenuItem.cpp: Added. 13 (WebKit::WebContextMenuItem::WebContextMenuItem): 14 (WebKit::WebContextMenuItem::encode): 15 (WebKit::WebContextMenuItem::decode): 16 (WebKit::kitItems): 17 * Shared/WebContextMenuItem.h: Added. 18 19 * UIProcess/API/mac/PageClientImpl.h: 20 * UIProcess/API/mac/PageClientImpl.mm: 21 (WebKit::PageClientImpl::createContextMenuProxy): 22 * UIProcess/API/qt/qwkpage.cpp: 23 (QWKPagePrivate::createContextMenuProxy): Stub to keep the build working. 24 * UIProcess/API/qt/qwkpage_p.h: 25 * UIProcess/PageClient.h: 26 27 * UIProcess/WebContextMenuProxy.cpp: Added. 28 (WebKit::WebContextMenuProxy::~WebContextMenuProxy): 29 (WebKit::WebContextMenuProxy::WebContextMenuProxy): 30 * UIProcess/WebContextMenuProxy.h: Added. 31 32 * UIProcess/WebPageProxy.cpp: 33 (WebKit::WebPageProxy::showContextMenu): Shows the menu after receiving the message from the WebProcess. 34 (WebKit::WebPageProxy::contextMenuItemSelected): Sends info about the selected menu item to the WebProcess 35 * UIProcess/WebPageProxy.h: 36 * UIProcess/WebPageProxy.messages.in: 37 38 * UIProcess/mac/WebContextMenuProxyMac.h: Added. 39 (WebKit::WebContextMenuProxyMac::create): 40 * UIProcess/mac/WebContextMenuProxyMac.mm: Added. 41 (+[WebMenuTarget sharedMenuTarget]): 42 (-[WebMenuTarget WebKit::]): 43 (-[WebMenuTarget setMenuProxy:WebKit::]): 44 (-[WebMenuTarget forwardContextMenuAction:]): 45 (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac): 46 (WebKit::WebContextMenuProxyMac::~WebContextMenuProxyMac): 47 (WebKit::WebContextMenuProxyMac::contextMenuItemSelected): 48 (WebKit::populateNSMenu): 49 (WebKit::nsMenuItemVector): 50 (WebKit::WebContextMenuProxyMac::populate): 51 (WebKit::WebContextMenuProxyMac::showContextMenu): 52 (WebKit::WebContextMenuProxyMac::hideContextMenu): 53 54 * UIProcess/win/WebView.cpp: 55 (WebKit::WebView::createContextMenuProxy): Stub for now. 56 * UIProcess/win/WebView.h: 57 58 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 59 (WebKit::WebChromeClient::showContextMenu): 60 * WebProcess/WebCoreSupport/WebChromeClient.h: 61 62 * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: 63 (WebKit::WebContextMenuClient::getCustomMenuFromDefaultItems): Return the WebCore-provided default 64 menu for now. Embedding app customization will come later (see bug 48720) 65 66 * WebProcess/WebPage/WebContextMenu.cpp: Added. 67 (WebKit::WebContextMenu::WebContextMenu): 68 (WebKit::WebContextMenu::~WebContextMenu): 69 (WebKit::WebContextMenu::show): 70 (WebKit::WebContextMenu::itemSelected): 71 * WebProcess/WebPage/WebContextMenu.h: Added. 72 (WebKit::WebContextMenu::create): 73 74 * WebProcess/WebPage/WebPage.cpp: 75 (WebKit::WebPage::contextMenu): 76 (WebKit::handleMouseEvent): Pass right mouse presses along to WebCore as both a mouse event and context menu event, 77 the same way WebKit1 does. 78 (WebKit::WebPage::didSelectItemFromActiveContextMenu): 79 * WebProcess/WebPage/WebPage.h: 80 * WebProcess/WebPage/WebPage.messages.in: 81 1 82 2010-11-01 Adam Roben <aroben@apple.com> 2 83 -
trunk/WebKit2/UIProcess/API/mac/PageClientImpl.h
r70730 r71041 67 67 68 68 virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(); 69 virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*); 69 70 70 71 void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut); -
trunk/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r70738 r71041 31 31 #import "WKStringCF.h" 32 32 #import "WKViewInternal.h" 33 #import "WebContextMenuProxyMac.h" 33 34 #import "WebEditCommandProxy.h" 34 35 #import "WebPopupMenuProxyMac.h" … … 246 247 } 247 248 249 PassRefPtr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy* page) 250 { 251 return WebContextMenuProxyMac::create(m_wkView, page); 252 } 253 248 254 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut) 249 255 { -
trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp
r71029 r71041 31 31 #include "NativeWebKeyboardEvent.h" 32 32 #include "WebContext.h" 33 #include "WebContextMenuProxy.h" 33 34 #include "WebEventFactoryQt.h" 34 35 #include "WebPlatformStrategies.h" … … 133 134 { 134 135 return WebPopupMenuProxyQt::create(); 136 } 137 138 PassRefPtr<WebContextMenuProxy> QWKPagePrivate::createContextMenuProxy(WebPageProxy*) 139 { 140 // FIXME: Implement; 141 return 0; 135 142 } 136 143 -
trunk/WebKit2/UIProcess/API/qt/qwkpage_p.h
r70734 r71041 62 62 virtual void didNotHandleKeyEvent(const WebKit::NativeWebKeyboardEvent&); 63 63 virtual PassRefPtr<WebKit::WebPopupMenuProxy> createPopupMenuProxy(); 64 virtual PassRefPtr<WebKit::WebContextMenuProxy> createContextMenuProxy(WebKit::WebPageProxy*); 64 65 65 66 virtual void setFindIndicator(PassRefPtr<WebKit::FindIndicator>, bool fadeOut); -
trunk/WebKit2/UIProcess/PageClient.h
r70730 r71041 40 40 class FindIndicator; 41 41 class NativeWebKeyboardEvent; 42 class NativeWebKeyboardEvent; 43 class WebContextMenuProxy; 42 44 class WebEditCommandProxy; 43 class NativeWebKeyboardEvent;44 45 class WebPopupMenuProxy; 45 46 … … 73 74 74 75 virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy() = 0; 76 virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) = 0; 75 77 76 78 virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut) = 0; -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r70894 r71041 37 37 #include "WebCertificateInfo.h" 38 38 #include "WebContext.h" 39 #include "WebContextMenuProxy.h" 39 40 #include "WebContextUserMessageCoders.h" 40 41 #include "WebCoreArgumentCoders.h" … … 1125 1126 } 1126 1127 1128 void WebPageProxy::showContextMenu(const WebCore::IntPoint& menuLocation, const Vector<WebContextMenuItem>& items) 1129 { 1130 if (m_activeContextMenu) 1131 m_activeContextMenu->hideContextMenu(); 1132 else 1133 m_activeContextMenu = m_pageClient->createContextMenuProxy(this); 1134 1135 m_activeContextMenu->showContextMenu(menuLocation, items); 1136 } 1137 1138 void WebPageProxy::contextMenuItemSelected(const WebContextMenuItem& item) 1139 { 1140 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID); 1141 } 1142 1127 1143 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo) 1128 1144 { -
trunk/WebKit2/UIProcess/WebPageProxy.h
r70894 r71041 33 33 #include "SharedMemory.h" 34 34 #include "WKBase.h" 35 #include "WebContextMenuItem.h" 35 36 #include "WebEvent.h" 36 37 #include "WebFindClient.h" … … 78 79 class WebBackForwardList; 79 80 class WebBackForwardListItem; 81 class WebContextMenuProxy; 80 82 class WebData; 81 83 class WebEditCommandProxy; … … 231 233 232 234 void getStatistics(WKContextStatistics*); 235 236 void contextMenuItemSelected(const WebContextMenuItem&); 233 237 234 238 private: … … 322 326 void hidePopupMenu(); 323 327 328 // Context Menu. 329 void showContextMenu(const WebCore::IntPoint&, const Vector<WebContextMenuItem>& items); 330 324 331 void takeFocus(bool direction); 325 332 void setToolTip(const String&); … … 362 369 363 370 RefPtr<WebPopupMenuProxy> m_activePopupMenu; 371 RefPtr<WebContextMenuProxy> m_activeContextMenu; 364 372 365 373 double m_estimatedProgress; -
trunk/WebKit2/UIProcess/WebPageProxy.messages.in
r70894 r71041 119 119 ShowPopupMenu(WebCore::IntRect rect, Vector<WebKit::WebPopupItem> items, int32_t selectedIndex) 120 120 HidePopupMenu() 121 122 # ContextMenu 123 ShowContextMenu(WebCore::IntPoint point, Vector<WebKit::WebContextMenuItem> items) 121 124 122 125 #if USE(ACCELERATED_COMPOSITING) -
trunk/WebKit2/UIProcess/win/WebView.cpp
r70885 r71041 626 626 } 627 627 628 PassRefPtr<WebContextMenuProxy> WebView::createContextMenuProxy(WebPageProxy*) 629 { 630 // FIXME: Implement. 631 return 0; 632 } 633 628 634 void WebView::setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut) 629 635 { -
trunk/WebKit2/UIProcess/win/WebView.h
r70362 r71041 106 106 virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&); 107 107 virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(); 108 virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*); 108 109 virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut); 109 110 -
trunk/WebKit2/WebKit2.pro
r70960 r71041 215 215 Shared/VisitedLinkTable.h \ 216 216 Shared/WebCertificateInfo.h \ 217 Shared/WebContextMenuItem.h \ 217 218 Shared/WebEvent.h \ 218 219 Shared/WebError.h \ … … 265 266 UIProcess/WebContext.h \ 266 267 UIProcess/WebContextInjectedBundleClient.h \ 268 UIProcess/WebContextMenuProxy.h \ 267 269 UIProcess/WebContextUserMessageCoders.h \ 268 270 UIProcess/WebEditCommandProxy.h \ … … 330 332 WebProcess/WebPage/FindPageOverlay.h \ 331 333 WebProcess/WebPage/PageOverlay.h \ 334 WebProcess/WebPage/WebContextMenu.h \ 332 335 WebProcess/WebPage/WebEditCommand.h \ 333 336 WebProcess/WebPage/WebFrame.h \ … … 377 380 Shared/qt/WebURLResponseQt.cpp \ 378 381 Shared/VisitedLinkTable.cpp \ 382 Shared/WebContextMenuItem.cpp \ 379 383 Shared/WebError.cpp \ 380 384 Shared/WebEvent.cpp \ … … 422 426 UIProcess/WebBackForwardListItem.cpp \ 423 427 UIProcess/WebContext.cpp \ 428 UIProcess/WebContextMenuProxy.cpp \ 424 429 UIProcess/WebContextInjectedBundleClient.cpp \ 425 430 UIProcess/WebEditCommandProxy.cpp \ … … 493 498 WebProcess/WebPage/FindPageOverlay.cpp \ 494 499 WebProcess/WebPage/PageOverlay.cpp \ 500 WebProcess/WebPage/WebContextMenu.cpp \ 495 501 WebProcess/WebPage/WebEditCommand.cpp \ 496 502 WebProcess/WebPage/WebFrame.cpp \ -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r70960 r71041 165 165 51578B831209ECEF00A37C4A /* WebData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51578B821209ECEF00A37C4A /* WebData.h */; }; 166 166 516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; }; 167 51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51871B59127CB89D00F76232 /* WebContextMenu.cpp */; }; 168 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 51871B5A127CB89D00F76232 /* WebContextMenu.h */; }; 167 169 51A7F2F3125BF820008AEB1D /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A7F2F2125BF820008AEB1D /* Logging.h */; }; 168 170 51A7F2F5125BF8D4008AEB1D /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A7F2F4125BF8D4008AEB1D /* Logging.cpp */; }; 171 51A84CE3127F386B00CA6EA4 /* WebContextMenuProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A84CE2127F386B00CA6EA4 /* WebContextMenuProxy.cpp */; }; 172 51ACBA151279E8C300D203B9 /* WebContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBA131279E8C300D203B9 /* WebContextMenuItem.cpp */; }; 173 51ACBA161279E8C300D203B9 /* WebContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACBA141279E8C300D203B9 /* WebContextMenuItem.h */; }; 174 51ACBB82127A8BAD00D203B9 /* WebContextMenuProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACBB81127A8BAD00D203B9 /* WebContextMenuProxy.h */; }; 175 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */; }; 176 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; }; 169 177 51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */; }; 170 178 51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */; }; … … 671 679 51578B821209ECEF00A37C4A /* WebData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebData.h; sourceTree = "<group>"; }; 672 680 516A4A5B120A2CCD00C05B7F /* WebError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebError.h; sourceTree = "<group>"; }; 681 51871B59127CB89D00F76232 /* WebContextMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenu.cpp; sourceTree = "<group>"; }; 682 51871B5A127CB89D00F76232 /* WebContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenu.h; sourceTree = "<group>"; }; 673 683 51A7F2F2125BF820008AEB1D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; }; 674 684 51A7F2F4125BF8D4008AEB1D /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; }; 685 51A84CE2127F386B00CA6EA4 /* WebContextMenuProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuProxy.cpp; sourceTree = "<group>"; }; 686 51ACBA131279E8C300D203B9 /* WebContextMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItem.cpp; sourceTree = "<group>"; }; 687 51ACBA141279E8C300D203B9 /* WebContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItem.h; sourceTree = "<group>"; }; 688 51ACBB81127A8BAD00D203B9 /* WebContextMenuProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuProxy.h; sourceTree = "<group>"; }; 689 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuProxyMac.h; sourceTree = "<group>"; }; 690 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuProxyMac.mm; sourceTree = "<group>"; }; 675 691 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebBackForwardListCF.cpp; path = cf/WebBackForwardListCF.cpp; sourceTree = "<group>"; }; 676 692 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageProxyCF.cpp; path = cf/WebPageProxyCF.cpp; sourceTree = "<group>"; }; … … 1275 1291 C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */, 1276 1292 BCC57161115ADB42001CCAF9 /* NotImplemented.h */, 1293 BCBD3C3A125BFA7A00D2C29F /* StringPairVector.h */, 1277 1294 BCB0B0DF12305AB100B1341E /* UserMessageCoders.h */, 1278 1295 1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */, … … 1280 1297 BC1DD7B1114DC396005ADAF3 /* WebCoreArgumentCoders.h */, 1281 1298 BCF50726124329AA005955AE /* WebCertificateInfo.h */, 1282 BCBD3C3A125BFA7A00D2C29F /* StringPairVector.h */, 1299 51ACBA131279E8C300D203B9 /* WebContextMenuItem.cpp */, 1300 51ACBA141279E8C300D203B9 /* WebContextMenuItem.h */, 1283 1301 51578B821209ECEF00A37C4A /* WebData.h */, 1284 1302 BC575612126E0138006F0F12 /* WebError.cpp */, … … 1452 1470 isa = PBXGroup; 1453 1471 children = ( 1472 51871B59127CB89D00F76232 /* WebContextMenu.cpp */, 1473 51871B5A127CB89D00F76232 /* WebContextMenu.h */, 1454 1474 BC963D6C113DD19500574BE2 /* mac */, 1455 1475 BC5F7BB21182376C0052C02C /* ChunkedUpdateDrawingArea.cpp */, … … 1509 1529 BCB9E2421120DACA00A137E0 /* WebContext.cpp */, 1510 1530 BCB9E2411120DACA00A137E0 /* WebContext.h */, 1531 51A84CE2127F386B00CA6EA4 /* WebContextMenuProxy.cpp */, 1532 51ACBB81127A8BAD00D203B9 /* WebContextMenuProxy.h */, 1511 1533 BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */, 1512 1534 BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */, … … 1862 1884 0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */, 1863 1885 1A1C648611F415B700553C19 /* WebContextMac.mm */, 1886 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */, 1887 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */, 1864 1888 BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */, 1865 1889 BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */, … … 2212 2236 1A616150127798B5003ACD86 /* DownloadManager.h in Headers */, 2213 2237 1A6161D41278981C003ACD86 /* Download.h in Headers */, 2238 51ACBA161279E8C300D203B9 /* WebContextMenuItem.h in Headers */, 2239 51ACBB82127A8BAD00D203B9 /* WebContextMenuProxy.h in Headers */, 2240 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */, 2214 2241 1A119A95127B796200A9ECB1 /* MessageSender.h in Headers */, 2242 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */, 2215 2243 ); 2216 2244 runOnlyForDeploymentPostprocessing = 0; … … 2535 2563 1A6161D51278981C003ACD86 /* Download.cpp in Sources */, 2536 2564 1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */, 2565 51ACBA151279E8C300D203B9 /* WebContextMenuItem.cpp in Sources */, 2566 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */, 2537 2567 C0337DAE127A24FE008FF4F4 /* WebEvent.cpp in Sources */, 2538 2568 C0337DB0127A28D0008FF4F4 /* WebMouseEvent.cpp in Sources */, … … 2541 2571 C0337DD8127A51B6008FF4F4 /* WebTouchEvent.cpp in Sources */, 2542 2572 C0337DDD127A521C008FF4F4 /* WebPlatformTouchPoint.cpp in Sources */, 2573 51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */, 2574 51A84CE3127F386B00CA6EA4 /* WebContextMenuProxy.cpp in Sources */, 2543 2575 ); 2544 2576 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r70936 r71041 32 32 #include "DrawingArea.h" 33 33 #include "InjectedBundleUserMessageCoders.h" 34 #include "WebContextMenu.h" 34 35 #include "WebCoreArgumentCoders.h" 35 36 #include "WebFrame.h" … … 526 527 } 527 528 529 #if ENABLE(CONTEXT_MENUS) 530 void WebChromeClient::showContextMenu() 531 { 532 m_page->contextMenu()->show(); 533 } 534 #endif 535 528 536 PassOwnPtr<HTMLParserQuirks> WebChromeClient::createHTMLParserQuirks() 529 537 { -
trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r70333 r71041 171 171 virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; 172 172 173 #if ENABLE(CONTEXT_MENUS) 174 virtual void showContextMenu(); 175 #endif 176 173 177 #if USE(ACCELERATED_COMPOSITING) 174 178 virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*); -
trunk/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
r62866 r71041 26 26 #include "WebContextMenuClient.h" 27 27 28 #include <WebCore/ContextMenu.h> 29 28 30 #define DISABLE_NOT_IMPLEMENTED_WARNINGS 1 29 31 #include "NotImplemented.h" … … 38 40 } 39 41 40 PlatformMenuDescription WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* )42 PlatformMenuDescription WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu) 41 43 { 42 notImplemented(); 43 return 0; 44 // FIXME: The embedded app needs a chance to customize the context menu, and that will probably happen 45 // via an injected bundle. <rdar://problem/8613727> and https://bugs.webkit.org/show_bug.cgi?id=48720 cover this task. 46 47 ASSERT(menu); 48 return menu->platformDescription(); 44 49 } 45 50 -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r70960 r71041 39 39 #include "WebBackForwardListProxy.h" 40 40 #include "WebChromeClient.h" 41 #include "WebContextMenu.h" 41 42 #include "WebContextMenuClient.h" 42 43 #include "WebCoreArgumentCoders.h" … … 54 55 #include "WebProcess.h" 55 56 #include "WebProcessProxyMessageKinds.h" 57 #include <WebCore/Chrome.h> 58 #include <WebCore/ContextMenuController.h> 56 59 #include <WebCore/EventHandler.h> 57 60 #include <WebCore/FocusController.h> … … 481 484 } 482 485 486 WebContextMenu* WebPage::contextMenu() 487 { 488 if (!m_contextMenu) 489 m_contextMenu = WebContextMenu::create(this); 490 return m_contextMenu.get(); 491 } 492 483 493 // Events 484 494 … … 520 530 switch (platformMouseEvent.eventType()) { 521 531 case WebCore::MouseEventPressed: 522 return frame->eventHandler()->handleMousePressEvent(platformMouseEvent); 532 { 533 if (platformMouseEvent.button() == WebCore::RightButton) 534 page->contextMenuController()->clearContextMenu(); 535 536 bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent); 537 538 if (platformMouseEvent.button() == WebCore::RightButton) { 539 handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent); 540 if (handled) 541 page->chrome()->showContextMenu(); 542 } 543 544 return handled; 545 } 523 546 case WebCore::MouseEventReleased: 524 547 return frame->eventHandler()->handleMouseReleaseEvent(platformMouseEvent); … … 884 907 } 885 908 909 void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItem& item) 910 { 911 ASSERT(m_contextMenu); 912 m_contextMenu->itemSelected(item); 913 m_contextMenu = 0; 914 } 915 886 916 #if PLATFORM(MAC) 887 917 void WebPage::addPluginView(PluginView* pluginView) -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r70934 r71041 69 69 class PageOverlay; 70 70 class PluginView; 71 class WebContextMenu; 72 class WebContextMenuItem; 71 73 class WebEvent; 72 74 class WebFrame; … … 187 189 188 190 void pageDidScroll(); 191 192 WebContextMenu* contextMenu(); 189 193 190 194 private: … … 253 257 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex); 254 258 259 #if ENABLE(CONTEXT_MENUS) 260 void didSelectItemFromActiveContextMenu(const WebContextMenuItem&); 261 #endif 262 255 263 OwnPtr<WebCore::Page> m_page; 256 264 RefPtr<WebFrame> m_mainFrame; … … 295 303 RefPtr<WebPopupMenu> m_activePopupMenu; 296 304 305 RefPtr<WebContextMenu> m_contextMenu; 306 297 307 uint64_t m_pageID; 298 308 }; -
trunk/WebKit2/WebProcess/WebPage/WebPage.messages.in
r70716 r71041 79 79 # Popup menu. 80 80 DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex); 81 82 # Context menu. 83 DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItem menuItem); 81 84 82 85 SetWindowResizerSize(WebCore::IntSize intersectsView) -
trunk/WebKit2/win/WebKit2.vcproj
r70960 r71041 490 490 </File> 491 491 <File 492 RelativePath="..\Shared\WebContextMenuItem.cpp" 493 > 494 </File> 495 <File 496 RelativePath="..\Shared\WebContextMenuItem.h" 497 > 498 </File> 499 <File 492 500 RelativePath="..\Shared\WebCoreArgumentCoders.h" 493 501 > … … 1189 1197 </File> 1190 1198 <File 1199 RelativePath="..\WebProcess\WebPage\WebContextMenu.cpp" 1200 > 1201 </File> 1202 <File 1203 RelativePath="..\WebProcess\WebPage\WebContextMenu.h" 1204 > 1205 </File> 1206 <File 1191 1207 RelativePath="..\WebProcess\WebPage\WebEditCommand.cpp" 1192 1208 > … … 1683 1699 <File 1684 1700 RelativePath="..\UIProcess\WebContextInjectedBundleClient.h" 1701 > 1702 </File> 1703 <File 1704 RelativePath="..\UIProcess\WebContextMenuProxy.cpp" 1705 > 1706 </File> 1707 <File 1708 RelativePath="..\UIProcess\WebContextMenuProxy.h" 1685 1709 > 1686 1710 </File>
Note: See TracChangeset
for help on using the changeset viewer.