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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 data.editFlags |= WebContextMenuData::CanSelectAll; | 208 data.editFlags |= WebContextMenuData::CanSelectAll; |
209 data.editFlags |= WebContextMenuData::CanTranslate; | 209 data.editFlags |= WebContextMenuData::CanTranslate; |
210 | 210 |
211 // Links, Images, Media tags, and Image/Media-Links take preference over | 211 // Links, Images, Media tags, and Image/Media-Links take preference over |
212 // all else. | 212 // all else. |
213 data.linkURL = r.absoluteLinkURL(); | 213 data.linkURL = r.absoluteLinkURL(); |
214 | 214 |
215 if (!r.absoluteImageURL().isEmpty()) { | 215 if (!r.absoluteImageURL().isEmpty()) { |
216 data.srcURL = r.absoluteImageURL(); | 216 data.srcURL = r.absoluteImageURL(); |
217 data.mediaType = WebContextMenuData::MediaTypeImage; | 217 data.mediaType = WebContextMenuData::MediaTypeImage; |
| 218 data.mediaFlags |= WebContextMenuData::MediaCanPrint; |
218 } else if (!r.absoluteMediaURL().isEmpty()) { | 219 } else if (!r.absoluteMediaURL().isEmpty()) { |
219 data.srcURL = r.absoluteMediaURL(); | 220 data.srcURL = r.absoluteMediaURL(); |
220 | 221 |
221 // We know that if absoluteMediaURL() is not empty, then this | 222 // We know that if absoluteMediaURL() is not empty, then this |
222 // is a media element. | 223 // is a media element. |
223 HTMLMediaElement* mediaElement = | 224 HTMLMediaElement* mediaElement = |
224 toMediaElement(r.innerNonSharedNode()); | 225 toMediaElement(r.innerNonSharedNode()); |
225 if (isHTMLVideoElement(mediaElement)) | 226 if (isHTMLVideoElement(mediaElement)) |
226 data.mediaType = WebContextMenuData::MediaTypeVideo; | 227 data.mediaType = WebContextMenuData::MediaTypeVideo; |
227 else if (mediaElement->hasTagName(HTMLNames::audioTag)) | 228 else if (mediaElement->hasTagName(HTMLNames::audioTag)) |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 outputItems[i] = subItems[i]; | 404 outputItems[i] = subItems[i]; |
404 subMenuItems.swap(outputItems); | 405 subMenuItems.swap(outputItems); |
405 } | 406 } |
406 | 407 |
407 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 408 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
408 { | 409 { |
409 populateSubMenuItems(defaultMenu->items(), data->customItems); | 410 populateSubMenuItems(defaultMenu->items(), data->customItems); |
410 } | 411 } |
411 | 412 |
412 } // namespace WebKit | 413 } // namespace WebKit |
OLD | NEW |