| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 if (markerRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation) != | 132 if (markerRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation) != |
| 133 selectionRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation)) | 133 selectionRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation)) |
| 134 return String(); | 134 return String(); |
| 135 | 135 |
| 136 return markerRange->text(); | 136 return markerRange->text(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool ContextMenuClientImpl::shouldShowContextMenuFromTouch( | 139 bool ContextMenuClientImpl::shouldShowContextMenuFromTouch( |
| 140 const WebContextMenuData& data) { | 140 const WebContextMenuData& data) { |
| 141 return m_webView->page()->settings().alwaysShowContextMenuOnTouch() || | 141 return m_webView->page()->settings().getAlwaysShowContextMenuOnTouch() || |
| 142 !data.linkURL.isEmpty() || | 142 !data.linkURL.isEmpty() || |
| 143 data.mediaType == WebContextMenuData::MediaTypeImage || | 143 data.mediaType == WebContextMenuData::MediaTypeImage || |
| 144 data.mediaType == WebContextMenuData::MediaTypeVideo || | 144 data.mediaType == WebContextMenuData::MediaTypeVideo || |
| 145 data.isEditable; | 145 data.isEditable; |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, | 148 bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, |
| 149 bool fromTouch) { | 149 bool fromTouch) { |
| 150 // Displaying the context menu in this function is a big hack as we don't | 150 // Displaying the context menu in this function is a big hack as we don't |
| 151 // have context, i.e. whether this is being invoked via a script or in | 151 // have context, i.e. whether this is being invoked via a script or in |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 subMenuItems.swap(outputItems); | 451 subMenuItems.swap(outputItems); |
| 452 } | 452 } |
| 453 | 453 |
| 454 void ContextMenuClientImpl::populateCustomMenuItems( | 454 void ContextMenuClientImpl::populateCustomMenuItems( |
| 455 const ContextMenu* defaultMenu, | 455 const ContextMenu* defaultMenu, |
| 456 WebContextMenuData* data) { | 456 WebContextMenuData* data) { |
| 457 populateSubMenuItems(defaultMenu->items(), data->customItems); | 457 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 458 } | 458 } |
| 459 | 459 |
| 460 } // namespace blink | 460 } // namespace blink |
| OLD | NEW |