| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (editor.CanRedo()) | 148 if (editor.CanRedo()) |
| 149 edit_flags |= WebContextMenuData::kCanRedo; | 149 edit_flags |= WebContextMenuData::kCanRedo; |
| 150 if (editor.CanCut()) | 150 if (editor.CanCut()) |
| 151 edit_flags |= WebContextMenuData::kCanCut; | 151 edit_flags |= WebContextMenuData::kCanCut; |
| 152 if (editor.CanCopy()) | 152 if (editor.CanCopy()) |
| 153 edit_flags |= WebContextMenuData::kCanCopy; | 153 edit_flags |= WebContextMenuData::kCanCopy; |
| 154 if (editor.CanPaste()) | 154 if (editor.CanPaste()) |
| 155 edit_flags |= WebContextMenuData::kCanPaste; | 155 edit_flags |= WebContextMenuData::kCanPaste; |
| 156 if (editor.CanDelete()) | 156 if (editor.CanDelete()) |
| 157 edit_flags |= WebContextMenuData::kCanDelete; | 157 edit_flags |= WebContextMenuData::kCanDelete; |
| 158 if (editor.CanEditRichly()) |
| 159 edit_flags |= WebContextMenuData::kCanEditRichly; |
| 158 if (selected_document.queryCommandEnabled("selectAll", ASSERT_NO_EXCEPTION)) | 160 if (selected_document.queryCommandEnabled("selectAll", ASSERT_NO_EXCEPTION)) |
| 159 edit_flags |= WebContextMenuData::kCanSelectAll; | 161 edit_flags |= WebContextMenuData::kCanSelectAll; |
| 160 return edit_flags; | 162 return edit_flags; |
| 161 } | 163 } |
| 162 | 164 |
| 163 bool ContextMenuClientImpl::ShouldShowContextMenuFromTouch( | 165 bool ContextMenuClientImpl::ShouldShowContextMenuFromTouch( |
| 164 const WebContextMenuData& data) { | 166 const WebContextMenuData& data) { |
| 165 return web_view_->GetPage() | 167 return web_view_->GetPage() |
| 166 ->GetSettings() | 168 ->GetSettings() |
| 167 .GetAlwaysShowContextMenuOnTouch() || | 169 .GetAlwaysShowContextMenuOnTouch() || |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 sub_menu_items.Swap(output_items); | 466 sub_menu_items.Swap(output_items); |
| 465 } | 467 } |
| 466 | 468 |
| 467 void ContextMenuClientImpl::PopulateCustomMenuItems( | 469 void ContextMenuClientImpl::PopulateCustomMenuItems( |
| 468 const ContextMenu* default_menu, | 470 const ContextMenu* default_menu, |
| 469 WebContextMenuData* data) { | 471 WebContextMenuData* data) { |
| 470 PopulateSubMenuItems(default_menu->Items(), data->custom_items); | 472 PopulateSubMenuItems(default_menu->Items(), data->custom_items); |
| 471 } | 473 } |
| 472 | 474 |
| 473 } // namespace blink | 475 } // namespace blink |
| OLD | NEW |