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

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: Updated Created 7 years, 6 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
« no previous file with comments | « Source/WebKit/chromium/src/WebPluginContainerImpl.h ('k') | 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 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent(); 752 const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent();
747 753
748 // Copy stashed info over, and only copy here in order not to interfere 754 // Copy stashed info over, and only copy here in order not to interfere
749 // the ctrl-c logic above. 755 // the ctrl-c logic above.
750 if (currentInputEvent 756 if (currentInputEvent
751 && WebInputEvent::isKeyboardEventType(currentInputEvent->type)) { 757 && WebInputEvent::isKeyboardEventType(currentInputEvent->type)) {
752 webEvent.modifiers |= currentInputEvent->modifiers & 758 webEvent.modifiers |= currentInputEvent->modifiers &
753 (WebInputEvent::CapsLockOn | WebInputEvent::NumLockOn); 759 (WebInputEvent::CapsLockOn | WebInputEvent::NumLockOn);
754 } 760 }
755 761
762 // Give the client a chance to issue edit comamnds.
763 WebViewImpl* view = WebViewImpl::fromPage(m_element->document()->frame()->pa ge());
764 if (m_webPlugin->supportsEditCommands() && view->client())
765 view->client()->handleCurrentKeyboardEvent();
766
756 WebCursorInfo cursorInfo; 767 WebCursorInfo cursorInfo;
757 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) 768 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
758 event->setDefaultHandled(); 769 event->setDefaultHandled();
759 } 770 }
760 771
761 void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) 772 void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event)
762 { 773 {
763 switch (m_touchEventRequestType) { 774 switch (m_touchEventRequestType) {
764 case TouchEventRequestTypeNone: 775 case TouchEventRequestTypeNone:
765 return; 776 return;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 // Take our element and get the clip rect from the enclosing layer and 873 // Take our element and get the clip rect from the enclosing layer and
863 // frame view. 874 // frame view.
864 clipRect.intersect( 875 clipRect.intersect(
865 m_element->document()->view()->windowClipRectForFrameOwner(m_element , true)); 876 m_element->document()->view()->windowClipRectForFrameOwner(m_element , true));
866 } 877 }
867 878
868 return clipRect; 879 return clipRect;
869 } 880 }
870 881
871 } // namespace WebKit 882 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebPluginContainerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698