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

Side by Side Diff: Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

Issue 15071004: Plumb edit commands to plugins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Alternative approach that gives plugin chance to override Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 21 matching lines...) Expand all
32 #include "WebPluginContainerImpl.h" 32 #include "WebPluginContainerImpl.h"
33 33
34 #include "ChromeClientImpl.h" 34 #include "ChromeClientImpl.h"
35 #include "ScrollbarGroup.h" 35 #include "ScrollbarGroup.h"
36 #include "WebCursorInfo.h" 36 #include "WebCursorInfo.h"
37 #include "WebDataSourceImpl.h" 37 #include "WebDataSourceImpl.h"
38 #include "WebElement.h" 38 #include "WebElement.h"
39 #include "WebInputEvent.h" 39 #include "WebInputEvent.h"
40 #include "WebInputEventConversion.h" 40 #include "WebInputEventConversion.h"
41 #include "WebPlugin.h" 41 #include "WebPlugin.h"
42 #include "WebViewClient.h"
42 #include "WebViewImpl.h" 43 #include "WebViewImpl.h"
43 #include "core/page/Chrome.h" 44 #include "core/page/Chrome.h"
44 #include "core/page/EventHandler.h" 45 #include "core/page/EventHandler.h"
45 #include "core/platform/chromium/ClipboardChromium.h" 46 #include "core/platform/chromium/ClipboardChromium.h"
46 #include "core/platform/chromium/support/WrappedResourceResponse.h" 47 #include "core/platform/chromium/support/WrappedResourceResponse.h"
47 48
48 #include "HTMLNames.h" 49 #include "HTMLNames.h"
49 #include "WebPrintParams.h" 50 #include "WebPrintParams.h"
50 #include "bindings/v8/ScriptController.h" 51 #include "bindings/v8/ScriptController.h"
51 #include "core/dom/EventNames.h" 52 #include "core/dom/EventNames.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (m_webPlugin->executeEditCommand(name)) 342 if (m_webPlugin->executeEditCommand(name))
342 return true; 343 return true;
343 344
344 if (name != "copy") 345 if (name != "copy")
345 return false; 346 return false;
346 347
347 copy(); 348 copy();
348 return true; 349 return true;
349 } 350 }
350 351
352 bool WebPluginContainerImpl::executeEditCommand(const WebString& name, const Web String& value)
353 {
354 return m_webPlugin->executeEditCommand(name, value);
355 }
356
351 WebElement WebPluginContainerImpl::element() 357 WebElement WebPluginContainerImpl::element()
352 { 358 {
353 return WebElement(m_element); 359 return WebElement(m_element);
354 } 360 }
355 361
356 void WebPluginContainerImpl::invalidate() 362 void WebPluginContainerImpl::invalidate()
357 { 363 {
358 Widget::invalidate(); 364 Widget::invalidate();
359 } 365 }
360 366
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent(); 749 const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent();
744 750
745 // Copy stashed info over, and only copy here in order not to interfere 751 // Copy stashed info over, and only copy here in order not to interfere
746 // the ctrl-c logic above. 752 // the ctrl-c logic above.
747 if (currentInputEvent 753 if (currentInputEvent
748 && WebInputEvent::isKeyboardEventType(currentInputEvent->type)) { 754 && WebInputEvent::isKeyboardEventType(currentInputEvent->type)) {
749 webEvent.modifiers |= currentInputEvent->modifiers & 755 webEvent.modifiers |= currentInputEvent->modifiers &
750 (WebInputEvent::CapsLockOn | WebInputEvent::NumLockOn); 756 (WebInputEvent::CapsLockOn | WebInputEvent::NumLockOn);
751 } 757 }
752 758
759 // Give the client a chance to issue edit comamnds.
760 WebViewImpl* view = WebViewImpl::fromPage(m_element->document()->frame()->pa ge());
abarth-chromium 2013/05/28 16:34:31 Do we know that frame() and page() return non-zero
Fady Samuel 2013/05/29 04:40:06 I believe so, plugins are created only if they're
761 if (m_webPlugin->supportsEditCommands() && view->client())
762 view->client()->handleCurrentKeyboardEvent();
763
753 WebCursorInfo cursorInfo; 764 WebCursorInfo cursorInfo;
754 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) 765 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
755 event->setDefaultHandled(); 766 event->setDefaultHandled();
756 } 767 }
757 768
758 void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) 769 void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event)
759 { 770 {
760 switch (m_touchEventRequestType) { 771 switch (m_touchEventRequestType) {
761 case TouchEventRequestTypeNone: 772 case TouchEventRequestTypeNone:
762 return; 773 return;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 // Take our element and get the clip rect from the enclosing layer and 870 // Take our element and get the clip rect from the enclosing layer and
860 // frame view. 871 // frame view.
861 clipRect.intersect( 872 clipRect.intersect(
862 m_element->document()->view()->windowClipRectForFrameOwner(m_element , true)); 873 m_element->document()->view()->windowClipRectForFrameOwner(m_element , true));
863 } 874 }
864 875
865 return clipRect; 876 return clipRect;
866 } 877 }
867 878
868 } // namespace WebKit 879 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698