Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1850)

Side by Side Diff: Source/web/ContextMenuClientImpl.cpp

Issue 942183005: Revert of Added code to fix visibility of select all option in context menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canRedo()) 212 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canRedo())
213 data.editFlags |= WebContextMenuData::CanRedo; 213 data.editFlags |= WebContextMenuData::CanRedo;
214 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCut()) 214 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCut())
215 data.editFlags |= WebContextMenuData::CanCut; 215 data.editFlags |= WebContextMenuData::CanCut;
216 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCopy()) 216 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCopy())
217 data.editFlags |= WebContextMenuData::CanCopy; 217 data.editFlags |= WebContextMenuData::CanCopy;
218 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canPaste()) 218 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canPaste())
219 data.editFlags |= WebContextMenuData::CanPaste; 219 data.editFlags |= WebContextMenuData::CanPaste;
220 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canDelete()) 220 if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canDelete())
221 data.editFlags |= WebContextMenuData::CanDelete; 221 data.editFlags |= WebContextMenuData::CanDelete;
222 if (isHTMLTextFormControlElement(r.innerNonSharedNode())) { 222 // We can always select all...
223 if (!toHTMLTextFormControlElement(r.innerNonSharedNode())->value().isEmp ty()) 223 data.editFlags |= WebContextMenuData::CanSelectAll;
224 data.editFlags |= WebContextMenuData::CanSelectAll;
225 }
226 data.editFlags |= WebContextMenuData::CanTranslate; 224 data.editFlags |= WebContextMenuData::CanTranslate;
227 225
228 // Links, Images, Media tags, and Image/Media-Links take preference over 226 // Links, Images, Media tags, and Image/Media-Links take preference over
229 // all else. 227 // all else.
230 data.linkURL = r.absoluteLinkURL(); 228 data.linkURL = r.absoluteLinkURL();
231 229
232 if (isHTMLCanvasElement(r.innerNonSharedNode())) { 230 if (isHTMLCanvasElement(r.innerNonSharedNode())) {
233 data.mediaType = WebContextMenuData::MediaTypeCanvas; 231 data.mediaType = WebContextMenuData::MediaTypeCanvas;
234 data.hasImageContents = true; 232 data.hasImageContents = true;
235 } else if (!r.absoluteImageURL().isEmpty()) { 233 } else if (!r.absoluteImageURL().isEmpty()) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 outputItems[i] = subItems[i]; 437 outputItems[i] = subItems[i];
440 subMenuItems.swap(outputItems); 438 subMenuItems.swap(outputItems);
441 } 439 }
442 440
443 void ContextMenuClientImpl::populateCustomMenuItems(const blink::ContextMenu* de faultMenu, WebContextMenuData* data) 441 void ContextMenuClientImpl::populateCustomMenuItems(const blink::ContextMenu* de faultMenu, WebContextMenuData* data)
444 { 442 {
445 populateSubMenuItems(defaultMenu->items(), data->customItems); 443 populateSubMenuItems(defaultMenu->items(), data->customItems);
446 } 444 }
447 445
448 } // namespace blink 446 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698