Changeset 104634 in webkit
- Timestamp:
- Jan 10, 2012 3:01:52 PM (12 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r104626 r104634 1 2012-01-10 Bill Budge <bbudge@chromium.org> 2 3 Allow plugins to add rotate items to browser's context menu. Adds a new 4 WebPluginAction struct, with rotate types. 5 https://bugs.webkit.org/show_bug.cgi?id=75645 6 7 Reviewed by Darin Fisher. 8 9 * WebKit.gyp: 10 * public/WebContextMenuData.h: 11 * public/WebPlugin.h: 12 (WebKit::WebPlugin::canRotateView): 13 (WebKit::WebPlugin::rotateView): 14 * public/WebPluginAction.h: Added. 15 (WebKit::WebPluginAction::WebPluginAction): 16 * public/WebView.h: 17 * src/ContextMenuClientImpl.cpp: 18 (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): 19 * src/WebViewImpl.cpp: 20 (WebKit::WebViewImpl::performMediaPlayerAction): 21 (WebKit::WebViewImpl::performPluginAction): 22 * src/WebViewImpl.h: 23 1 24 2012-01-10 Dana Jansens <danakj@chromium.org> 2 25 -
trunk/Source/WebKit/chromium/WebKit.gyp
r104607 r104634 217 217 'public/WebPermissionClient.h', 218 218 'public/WebPlugin.h', 219 'public/WebPluginAction.h', 219 220 'public/WebPluginContainer.h', 220 221 'public/WebPluginDocument.h', -
trunk/Source/WebKit/chromium/public/WebContextMenuData.h
r101709 r104634 1 1 /* 2 * Copyright (C) 2009 Google Inc. All rights reserved.2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 103 103 MediaControlRootElement = 0x80, 104 104 MediaCanPrint = 0x100, 105 MediaCanRotate = 0x200, 105 106 }; 106 107 -
trunk/Source/WebKit/chromium/public/WebPlugin.h
r103147 r104634 1 1 /* 2 * Copyright (C) 2009 Google Inc. All rights reserved.2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 126 126 virtual void stopFind() { } 127 127 128 // View rotation types. 129 enum RotationType { 130 RotationType90Clockwise, 131 RotationType90Counterclockwise 132 }; 133 // Whether the plugin can rotate the view of its content. 134 virtual bool canRotateView() { return false; } 135 // Rotates the plugin's view of its content. 136 virtual void rotateView(RotationType type) { } 137 128 138 protected: 129 139 ~WebPlugin() { } -
trunk/Source/WebKit/chromium/public/WebView.h
r104537 r104634 56 56 class WebViewClient; 57 57 struct WebMediaPlayerAction; 58 struct WebPluginAction; 58 59 struct WebPoint; 59 60 … … 274 275 // Media --------------------------------------------------------------- 275 276 276 // Performs the specified action on the node at the given location.277 // Performs the specified media player action on the node at the given location. 277 278 virtual void performMediaPlayerAction( 278 279 const WebMediaPlayerAction&, const WebPoint& location) = 0; 280 281 // Performs the specified plugin action on the node at the given location. 282 virtual void performPluginAction( 283 const WebPluginAction&, const WebPoint& location) = 0; 279 284 280 285 -
trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
r102044 r104634 1 1 /* 2 * Copyright (C) 2009 Google Inc. All rights reserved.2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 235 235 data.srcURL = pluginElement->document()->completeURL(pluginElement->url()); 236 236 data.mediaFlags |= WebContextMenuData::MediaCanSave; 237 238 // Add context menu commands that are supported by the plugin. 239 if (plugin->plugin()->canRotateView()) 240 data.mediaFlags |= WebContextMenuData::MediaCanRotate; 237 241 } 238 242 } -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r104600 r104634 1 1 /* 2 * Copyright (C) 2011 Google Inc. All rights reserved.2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 96 96 #include "RenderLayerCompositor.h" 97 97 #include "RenderView.h" 98 #include "RenderWidget.h" 98 99 #include "ResourceHandle.h" 99 100 #include "SchemeRegistry.h" … … 126 127 #include "WebNode.h" 127 128 #include "WebPlugin.h" 129 #include "WebPluginAction.h" 128 130 #include "WebPluginContainerImpl.h" 129 131 #include "platform/WebPoint.h" … … 2184 2186 RefPtr<Node> node = result.innerNonSharedNode(); 2185 2187 if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag)) 2186 return;2188 return; 2187 2189 2188 2190 RefPtr<HTMLMediaElement> mediaElement = … … 2209 2211 } 2210 2212 2213 void WebViewImpl::performPluginAction(const WebPluginAction& action, 2214 const WebPoint& location) 2215 { 2216 HitTestResult result = hitTestResultForWindowPos(location); 2217 RefPtr<Node> node = result.innerNonSharedNode(); 2218 if (!node->hasTagName(HTMLNames::objectTag) && !node->hasTagName(HTMLNames::embedTag)) 2219 return; 2220 2221 RenderObject* object = node->renderer(); 2222 if (object && object->isWidget()) { 2223 Widget* widget = toRenderWidget(object)->widget(); 2224 if (widget && widget->isPluginContainer()) { 2225 WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget); 2226 switch (action.type) { 2227 case WebPluginAction::Rotate90Clockwise: 2228 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise); 2229 break; 2230 case WebPluginAction::Rotate90Counterclockwise: 2231 plugin->plugin()->rotateView(WebPlugin::RotationType90Counterclockwise); 2232 break; 2233 default: 2234 ASSERT_NOT_REACHED(); 2235 } 2236 } 2237 } 2238 } 2239 2211 2240 void WebViewImpl::copyImageAt(const WebPoint& point) 2212 2241 { -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r104248 r104634 187 187 const WebMediaPlayerAction& action, 188 188 const WebPoint& location); 189 virtual void performPluginAction( 190 const WebPluginAction&, 191 const WebPoint&); 189 192 virtual void copyImageAt(const WebPoint& point); 190 193 virtual void dragSourceEndedAt(
Note: See TracChangeset
for help on using the changeset viewer.