| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 if (mediaElement->paused()) | 235 if (mediaElement->paused()) |
| 236 data.mediaFlags |= WebContextMenuData::MediaPaused; | 236 data.mediaFlags |= WebContextMenuData::MediaPaused; |
| 237 if (mediaElement->muted()) | 237 if (mediaElement->muted()) |
| 238 data.mediaFlags |= WebContextMenuData::MediaMuted; | 238 data.mediaFlags |= WebContextMenuData::MediaMuted; |
| 239 if (mediaElement->loop()) | 239 if (mediaElement->loop()) |
| 240 data.mediaFlags |= WebContextMenuData::MediaLoop; | 240 data.mediaFlags |= WebContextMenuData::MediaLoop; |
| 241 if (mediaElement->supportsSave()) | 241 if (mediaElement->supportsSave()) |
| 242 data.mediaFlags |= WebContextMenuData::MediaCanSave; | 242 data.mediaFlags |= WebContextMenuData::MediaCanSave; |
| 243 if (mediaElement->hasAudio()) | 243 if (mediaElement->hasAudio()) |
| 244 data.mediaFlags |= WebContextMenuData::MediaHasAudio; | 244 data.mediaFlags |= WebContextMenuData::MediaHasAudio; |
| 245 if (mediaElement->hasVideo()) | 245 if (mediaElement->hasVideo() && !mediaElement->isFullscreen()) |
| 246 data.mediaFlags |= WebContextMenuData::MediaHasVideo; | 246 data.mediaFlags |= WebContextMenuData::MediaCanToggleControls; |
| 247 if (mediaElement->controls()) | 247 if (mediaElement->controls()) |
| 248 data.mediaFlags |= WebContextMenuData::MediaControls; | 248 data.mediaFlags |= WebContextMenuData::MediaControls; |
| 249 } else if (isHTMLObjectElement(*r.innerNonSharedNode()) || isHTMLEmbedElemen
t(*r.innerNonSharedNode())) { | 249 } else if (isHTMLObjectElement(*r.innerNonSharedNode()) || isHTMLEmbedElemen
t(*r.innerNonSharedNode())) { |
| 250 RenderObject* object = r.innerNonSharedNode()->renderer(); | 250 RenderObject* object = r.innerNonSharedNode()->renderer(); |
| 251 if (object && object->isWidget()) { | 251 if (object && object->isWidget()) { |
| 252 Widget* widget = toRenderWidget(object)->widget(); | 252 Widget* widget = toRenderWidget(object)->widget(); |
| 253 if (widget && widget->isPluginContainer()) { | 253 if (widget && widget->isPluginContainer()) { |
| 254 data.mediaType = WebContextMenuData::MediaTypePlugin; | 254 data.mediaType = WebContextMenuData::MediaTypePlugin; |
| 255 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget
); | 255 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget
); |
| 256 WebString text = plugin->plugin()->selectionAsText(); | 256 WebString text = plugin->plugin()->selectionAsText(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 outputItems[i] = subItems[i]; | 416 outputItems[i] = subItems[i]; |
| 417 subMenuItems.swap(outputItems); | 417 subMenuItems.swap(outputItems); |
| 418 } | 418 } |
| 419 | 419 |
| 420 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 420 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
| 421 { | 421 { |
| 422 populateSubMenuItems(defaultMenu->items(), data->customItems); | 422 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 423 } | 423 } |
| 424 | 424 |
| 425 } // namespace blink | 425 } // namespace blink |
| OLD | NEW |