| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // toggling is ignored in that case. | 243 // toggling is ignored in that case. |
| 244 if (mediaElement->isHTMLVideoElement() && mediaElement->hasVideo() && | 244 if (mediaElement->isHTMLVideoElement() && mediaElement->hasVideo() && |
| 245 !mediaElement->isFullscreen()) | 245 !mediaElement->isFullscreen()) |
| 246 data.mediaFlags |= WebContextMenuData::MediaCanToggleControls; | 246 data.mediaFlags |= WebContextMenuData::MediaCanToggleControls; |
| 247 if (mediaElement->shouldShowControls()) | 247 if (mediaElement->shouldShowControls()) |
| 248 data.mediaFlags |= WebContextMenuData::MediaControls; | 248 data.mediaFlags |= WebContextMenuData::MediaControls; |
| 249 } else if (isHTMLObjectElement(*r.innerNode()) || | 249 } else if (isHTMLObjectElement(*r.innerNode()) || |
| 250 isHTMLEmbedElement(*r.innerNode())) { | 250 isHTMLEmbedElement(*r.innerNode())) { |
| 251 LayoutObject* object = r.innerNode()->layoutObject(); | 251 LayoutObject* object = r.innerNode()->layoutObject(); |
| 252 if (object && object->isLayoutPart()) { | 252 if (object && object->isLayoutPart()) { |
| 253 FrameViewBase* frameViewBase = toLayoutPart(object)->widget(); | 253 FrameViewBase* frameViewBase = toLayoutPart(object)->frameViewBase(); |
| 254 if (frameViewBase && frameViewBase->isPluginContainer()) { | 254 if (frameViewBase && frameViewBase->isPluginContainer()) { |
| 255 data.mediaType = WebContextMenuData::MediaTypePlugin; | 255 data.mediaType = WebContextMenuData::MediaTypePlugin; |
| 256 WebPluginContainerImpl* plugin = | 256 WebPluginContainerImpl* plugin = |
| 257 toWebPluginContainerImpl(frameViewBase); | 257 toWebPluginContainerImpl(frameViewBase); |
| 258 WebString text = plugin->plugin()->selectionAsText(); | 258 WebString text = plugin->plugin()->selectionAsText(); |
| 259 if (!text.isEmpty()) { | 259 if (!text.isEmpty()) { |
| 260 data.selectedText = text; | 260 data.selectedText = text; |
| 261 data.editFlags |= WebContextMenuData::CanCopy; | 261 data.editFlags |= WebContextMenuData::CanCopy; |
| 262 } | 262 } |
| 263 data.editFlags &= ~WebContextMenuData::CanTranslate; | 263 data.editFlags &= ~WebContextMenuData::CanTranslate; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 subMenuItems.swap(outputItems); | 448 subMenuItems.swap(outputItems); |
| 449 } | 449 } |
| 450 | 450 |
| 451 void ContextMenuClientImpl::populateCustomMenuItems( | 451 void ContextMenuClientImpl::populateCustomMenuItems( |
| 452 const ContextMenu* defaultMenu, | 452 const ContextMenu* defaultMenu, |
| 453 WebContextMenuData* data) { | 453 WebContextMenuData* data) { |
| 454 populateSubMenuItems(defaultMenu->items(), data->customItems); | 454 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace blink | 457 } // namespace blink |
| OLD | NEW |