| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (!text.isEmpty()) { | 255 if (!text.isEmpty()) { |
| 256 data.selectedText = text; | 256 data.selectedText = text; |
| 257 data.editFlags |= WebContextMenuData::CanCopy; | 257 data.editFlags |= WebContextMenuData::CanCopy; |
| 258 } | 258 } |
| 259 data.editFlags &= ~WebContextMenuData::CanTranslate; | 259 data.editFlags &= ~WebContextMenuData::CanTranslate; |
| 260 data.linkURL = plugin->plugin()->linkAtPosition(data.mousePositi
on); | 260 data.linkURL = plugin->plugin()->linkAtPosition(data.mousePositi
on); |
| 261 if (plugin->plugin()->supportsPaginatedPrint()) | 261 if (plugin->plugin()->supportsPaginatedPrint()) |
| 262 data.mediaFlags |= WebContextMenuData::MediaCanPrint; | 262 data.mediaFlags |= WebContextMenuData::MediaCanPrint; |
| 263 | 263 |
| 264 HTMLPlugInImageElement* pluginElement = toHTMLPlugInImageElement
(r.innerNonSharedNode()); | 264 HTMLPlugInImageElement* pluginElement = toHTMLPlugInImageElement
(r.innerNonSharedNode()); |
| 265 data.srcURL = pluginElement->document()->completeURL(pluginEleme
nt->url()); | 265 data.srcURL = pluginElement->document().completeURL(pluginElemen
t->url()); |
| 266 data.mediaFlags |= WebContextMenuData::MediaCanSave; | 266 data.mediaFlags |= WebContextMenuData::MediaCanSave; |
| 267 | 267 |
| 268 // Add context menu commands that are supported by the plugin. | 268 // Add context menu commands that are supported by the plugin. |
| 269 if (plugin->plugin()->canRotateView()) | 269 if (plugin->plugin()->canRotateView()) |
| 270 data.mediaFlags |= WebContextMenuData::MediaCanRotate; | 270 data.mediaFlags |= WebContextMenuData::MediaCanRotate; |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 | 274 |
| 275 // An image can to be null for many reasons, like being blocked, no image | 275 // An image can to be null for many reasons, like being blocked, no image |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 outputItems[i] = subItems[i]; | 412 outputItems[i] = subItems[i]; |
| 413 subMenuItems.swap(outputItems); | 413 subMenuItems.swap(outputItems); |
| 414 } | 414 } |
| 415 | 415 |
| 416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
| 417 { | 417 { |
| 418 populateSubMenuItems(defaultMenu->items(), data->customItems); | 418 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 419 } | 419 } |
| 420 | 420 |
| 421 } // namespace WebKit | 421 } // namespace WebKit |
| OLD | NEW |