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

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

Issue 2759063002: Remove most of Widget (FrameViewBase) class from HTMLPlugInElement. (Closed)
Patch Set: Fix shouldAccelerate Created 3 years, 9 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
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (mediaElement->shouldShowControls()) 251 if (mediaElement->shouldShowControls())
252 data.mediaFlags |= WebContextMenuData::MediaControls; 252 data.mediaFlags |= WebContextMenuData::MediaControls;
253 } else if (isHTMLObjectElement(*r.innerNode()) || 253 } else if (isHTMLObjectElement(*r.innerNode()) ||
254 isHTMLEmbedElement(*r.innerNode())) { 254 isHTMLEmbedElement(*r.innerNode())) {
255 LayoutObject* object = r.innerNode()->layoutObject(); 255 LayoutObject* object = r.innerNode()->layoutObject();
256 if (object && object->isLayoutPart()) { 256 if (object && object->isLayoutPart()) {
257 FrameViewBase* frameViewBase = toLayoutPart(object)->frameViewBase(); 257 FrameViewBase* frameViewBase = toLayoutPart(object)->frameViewBase();
258 if (frameViewBase && frameViewBase->isPluginContainer()) { 258 if (frameViewBase && frameViewBase->isPluginContainer()) {
259 data.mediaType = WebContextMenuData::MediaTypePlugin; 259 data.mediaType = WebContextMenuData::MediaTypePlugin;
260 WebPluginContainerImpl* plugin = 260 WebPluginContainerImpl* plugin =
261 toWebPluginContainerImpl(frameViewBase); 261 toWebPluginContainerImpl(toPluginView(frameViewBase));
262 WebString text = plugin->plugin()->selectionAsText(); 262 WebString text = plugin->plugin()->selectionAsText();
263 if (!text.isEmpty()) { 263 if (!text.isEmpty()) {
264 data.selectedText = text; 264 data.selectedText = text;
265 data.editFlags |= WebContextMenuData::CanCopy; 265 data.editFlags |= WebContextMenuData::CanCopy;
266 } 266 }
267 data.editFlags &= ~WebContextMenuData::CanTranslate; 267 data.editFlags &= ~WebContextMenuData::CanTranslate;
268 data.linkURL = plugin->plugin()->linkAtPosition(data.mousePosition); 268 data.linkURL = plugin->plugin()->linkAtPosition(data.mousePosition);
269 if (plugin->plugin()->supportsPaginatedPrint()) 269 if (plugin->plugin()->supportsPaginatedPrint())
270 data.mediaFlags |= WebContextMenuData::MediaCanPrint; 270 data.mediaFlags |= WebContextMenuData::MediaCanPrint;
271 271
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/EmptyClients.cpp ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698