| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool ContextMenuClientImpl::ShouldShowContextMenuFromTouch( | 192 bool ContextMenuClientImpl::ShouldShowContextMenuFromTouch( |
| 193 const WebContextMenuData& data) { | 193 const WebContextMenuData& data) { |
| 194 return web_view_->GetPage() | 194 return web_view_->GetPage() |
| 195 ->GetSettings() | 195 ->GetSettings() |
| 196 .GetAlwaysShowContextMenuOnTouch() || | 196 .GetAlwaysShowContextMenuOnTouch() || |
| 197 !data.link_url.IsEmpty() || | 197 !data.link_url.IsEmpty() || |
| 198 data.media_type == WebContextMenuData::kMediaTypeImage || | 198 data.media_type == WebContextMenuData::kMediaTypeImage || |
| 199 data.media_type == WebContextMenuData::kMediaTypeVideo || | 199 data.media_type == WebContextMenuData::kMediaTypeVideo || |
| 200 data.is_editable; | 200 data.is_editable || !data.selected_text.IsEmpty(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 static HTMLFormElement* AssociatedFormElement(HTMLElement& element) { | 203 static HTMLFormElement* AssociatedFormElement(HTMLElement& element) { |
| 204 if (isHTMLFormElement(element)) | 204 if (isHTMLFormElement(element)) |
| 205 return &toHTMLFormElement(element); | 205 return &toHTMLFormElement(element); |
| 206 return element.formOwner(); | 206 return element.formOwner(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Scans logically forward from "start", including any child frames. | 209 // Scans logically forward from "start", including any child frames. |
| 210 static HTMLFormElement* ScanForForm(const Node* start) { | 210 static HTMLFormElement* ScanForForm(const Node* start) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 sub_menu_items.Swap(output_items); | 559 sub_menu_items.Swap(output_items); |
| 560 } | 560 } |
| 561 | 561 |
| 562 void ContextMenuClientImpl::PopulateCustomMenuItems( | 562 void ContextMenuClientImpl::PopulateCustomMenuItems( |
| 563 const ContextMenu* default_menu, | 563 const ContextMenu* default_menu, |
| 564 WebContextMenuData* data) { | 564 WebContextMenuData* data) { |
| 565 PopulateSubMenuItems(default_menu->Items(), data->custom_items); | 565 PopulateSubMenuItems(default_menu->Items(), data->custom_items); |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace blink | 568 } // namespace blink |
| OLD | NEW |