| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canRedo()) | 173 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canRedo()) |
| 174 data.editFlags |= WebContextMenuData::CanRedo; | 174 data.editFlags |= WebContextMenuData::CanRedo; |
| 175 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canCut()) | 175 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canCut()) |
| 176 data.editFlags |= WebContextMenuData::CanCut; | 176 data.editFlags |= WebContextMenuData::CanCut; |
| 177 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canCopy()) | 177 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canCopy()) |
| 178 data.editFlags |= WebContextMenuData::CanCopy; | 178 data.editFlags |= WebContextMenuData::CanCopy; |
| 179 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canPaste()) | 179 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canPaste()) |
| 180 data.editFlags |= WebContextMenuData::CanPaste; | 180 data.editFlags |= WebContextMenuData::CanPaste; |
| 181 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canDelete()) | 181 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canDelete()) |
| 182 data.editFlags |= WebContextMenuData::CanDelete; | 182 data.editFlags |= WebContextMenuData::CanDelete; |
| 183 // We can always select all... | 183 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canSelectAll()) |
| 184 data.editFlags |= WebContextMenuData::CanSelectAll; | 184 data.editFlags |= WebContextMenuData::CanSelectAll; |
| 185 data.editFlags |= WebContextMenuData::CanTranslate; | 185 data.editFlags |= WebContextMenuData::CanTranslate; |
| 186 | 186 |
| 187 // Links, Images, Media tags, and Image/Media-Links take preference over | 187 // Links, Images, Media tags, and Image/Media-Links take preference over |
| 188 // all else. | 188 // all else. |
| 189 data.linkURL = r.absoluteLinkURL(); | 189 data.linkURL = r.absoluteLinkURL(); |
| 190 | 190 |
| 191 if (r.innerNode()->isHTMLElement()) { | 191 if (r.innerNode()->isHTMLElement()) { |
| 192 HTMLElement* htmlElement = toHTMLElement(r.innerNode()); | 192 HTMLElement* htmlElement = toHTMLElement(r.innerNode()); |
| 193 if (!htmlElement->title().isEmpty()) { | 193 if (!htmlElement->title().isEmpty()) { |
| 194 data.titleText = htmlElement->title(); | 194 data.titleText = htmlElement->title(); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 subMenuItems.swap(outputItems); | 452 subMenuItems.swap(outputItems); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void ContextMenuClientImpl::populateCustomMenuItems( | 455 void ContextMenuClientImpl::populateCustomMenuItems( |
| 456 const ContextMenu* defaultMenu, | 456 const ContextMenu* defaultMenu, |
| 457 WebContextMenuData* data) { | 457 WebContextMenuData* data) { |
| 458 populateSubMenuItems(defaultMenu->items(), data->customItems); | 458 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |