Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 #include "core/input/EventHandler.h" | 43 #include "core/input/EventHandler.h" |
| 44 #include "core/layout/LayoutView.h" | 44 #include "core/layout/LayoutView.h" |
| 45 #include "core/layout/api/LayoutViewItem.h" | 45 #include "core/layout/api/LayoutViewItem.h" |
| 46 #include "core/layout/compositing/PaintLayerCompositor.h" | 46 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 47 #include "core/page/ContextMenuController.h" | 47 #include "core/page/ContextMenuController.h" |
| 48 #include "core/page/FocusController.h" | 48 #include "core/page/FocusController.h" |
| 49 #include "core/page/Page.h" | 49 #include "core/page/Page.h" |
| 50 #include "platform/KeyboardCodes.h" | 50 #include "platform/KeyboardCodes.h" |
| 51 #include "platform/graphics/CompositorMutatorClient.h" | 51 #include "platform/graphics/CompositorMutatorClient.h" |
| 52 #include "public/platform/WebFrameScheduler.h" | 52 #include "public/platform/WebFrameScheduler.h" |
| 53 #include "public/web/WebRange.h" | |
| 53 #include "public/web/WebWidgetClient.h" | 54 #include "public/web/WebWidgetClient.h" |
| 54 #include "web/CompositorMutatorImpl.h" | 55 #include "web/CompositorMutatorImpl.h" |
| 55 #include "web/CompositorProxyClientImpl.h" | 56 #include "web/CompositorProxyClientImpl.h" |
| 56 #include "web/ContextMenuAllowedScope.h" | 57 #include "web/ContextMenuAllowedScope.h" |
| 57 #include "web/WebDevToolsAgentImpl.h" | 58 #include "web/WebDevToolsAgentImpl.h" |
| 58 #include "web/WebInputEventConversion.h" | 59 #include "web/WebInputEventConversion.h" |
| 59 #include "web/WebLocalFrameImpl.h" | 60 #include "web/WebLocalFrameImpl.h" |
| 60 #include "web/WebPluginContainerImpl.h" | 61 #include "web/WebPluginContainerImpl.h" |
| 61 #include "web/WebRemoteFrameImpl.h" | 62 #include "web/WebRemoteFrameImpl.h" |
| 62 #include "web/WebViewFrameWidget.h" | 63 #include "web/WebViewFrameWidget.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 } | 460 } |
| 460 } | 461 } |
| 461 } | 462 } |
| 462 | 463 |
| 463 bool WebFrameWidgetImpl::setComposition( | 464 bool WebFrameWidgetImpl::setComposition( |
| 464 const WebString& text, | 465 const WebString& text, |
| 465 const WebVector<WebCompositionUnderline>& underlines, | 466 const WebVector<WebCompositionUnderline>& underlines, |
| 466 int selectionStart, | 467 int selectionStart, |
| 467 int selectionEnd) | 468 int selectionEnd) |
| 468 { | 469 { |
| 469 // FIXME: To be implemented. | 470 return view()->setComposition(text, underlines, selectionStart, selectionEnd ); |
| 470 return false; | |
| 471 } | 471 } |
| 472 | 472 |
| 473 bool WebFrameWidgetImpl::confirmComposition() | 473 bool WebFrameWidgetImpl::confirmComposition() |
| 474 { | 474 { |
| 475 // FIXME: To be implemented. | 475 // FIXME: To be implemented. |
| 476 return false; | 476 return view()->confirmComposition(); |
| 477 } | 477 } |
| 478 | 478 |
| 479 bool WebFrameWidgetImpl::confirmComposition(ConfirmCompositionBehavior selection Behavior) | 479 bool WebFrameWidgetImpl::confirmComposition(ConfirmCompositionBehavior selection Behavior) |
| 480 { | 480 { |
| 481 // FIXME: To be implemented. | 481 return view()->confirmComposition(selectionBehavior); |
| 482 return false; | |
| 483 } | 482 } |
| 484 | 483 |
| 485 bool WebFrameWidgetImpl::confirmComposition(const WebString& text) | 484 bool WebFrameWidgetImpl::confirmComposition(const WebString& text) |
| 486 { | 485 { |
| 487 // FIXME: To be implemented. | 486 return view()->confirmComposition(text); |
| 488 return false; | |
| 489 } | 487 } |
| 490 | 488 |
| 491 bool WebFrameWidgetImpl::compositionRange(size_t* location, size_t* length) | 489 bool WebFrameWidgetImpl::compositionRange(size_t* location, size_t* length) |
| 492 { | 490 { |
| 493 // FIXME: To be implemented. | 491 return view()->compositionRange(location, length); |
| 494 return false; | |
| 495 } | 492 } |
| 496 | 493 |
| 497 WebTextInputInfo WebFrameWidgetImpl::textInputInfo() | 494 WebTextInputInfo WebFrameWidgetImpl::textInputInfo() |
| 498 { | 495 { |
| 499 return view()->textInputInfo(); | 496 return view()->textInputInfo(); |
| 500 } | 497 } |
| 501 | 498 |
| 502 WebTextInputType WebFrameWidgetImpl::textInputType() | 499 WebTextInputType WebFrameWidgetImpl::textInputType() |
| 503 { | 500 { |
| 504 return view()->textInputType(); | 501 return view()->textInputType(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 638 m_layerTreeView = nullptr; | 635 m_layerTreeView = nullptr; |
| 639 m_layerTreeViewClosed = true; | 636 m_layerTreeViewClosed = true; |
| 640 } | 637 } |
| 641 | 638 |
| 642 void WebFrameWidgetImpl::didChangeWindowResizerRect() | 639 void WebFrameWidgetImpl::didChangeWindowResizerRect() |
| 643 { | 640 { |
| 644 if (m_localRoot->frameView()) | 641 if (m_localRoot->frameView()) |
| 645 m_localRoot->frameView()->windowResizerRectChanged(); | 642 m_localRoot->frameView()->windowResizerRectChanged(); |
| 646 } | 643 } |
| 647 | 644 |
| 645 bool WebFrameWidgetImpl::getCompositionCharacterBounds(WebVector<WebRect>& bound s) | |
| 646 { | |
| 647 size_t offset = 0; | |
| 648 size_t characterCount = 0; | |
| 649 if (!compositionRange(&offset, &characterCount)) | |
| 650 return false; | |
| 651 | |
| 652 if (characterCount == 0) | |
| 653 return false; | |
| 654 | |
| 655 WebLocalFrame* frame = view()->focusedFrame()->toWebLocalFrame(); | |
|
kenrb
2016/06/10 20:52:03
Should this call focusedWebLocalFrameInWidget()?
EhsanK
2016/06/27 21:14:50
Yes, I think it has to. Thanks for pointing this o
| |
| 656 if (!frame) | |
| 657 return false; | |
| 658 | |
| 659 WebVector<WebRect> result(characterCount); | |
| 660 WebRect webrect; | |
| 661 for (size_t i = 0; i < characterCount; ++i) { | |
| 662 if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) { | |
| 663 DLOG(ERROR) << "Could not retrieve character rectangle at " << i; | |
| 664 return false; | |
| 665 } | |
| 666 result[i] = webrect; | |
| 667 } | |
| 668 bounds.swap(result); | |
| 669 return true; | |
| 670 } | |
| 671 | |
| 672 void WebFrameWidgetImpl::adjustReplacementRangeForAccentedCharacters(int start, int length) | |
| 673 { | |
| 674 if (WebLocalFrame* frame = focusedWebLocalFrameInWidget()) { | |
| 675 WebRange webrange = WebRange::fromDocumentRange(frame, start, length); | |
| 676 if (!webrange.isNull()) | |
| 677 frame->selectRange(webrange); | |
| 678 } | |
| 679 } | |
| 680 | |
| 648 void WebFrameWidgetImpl::handleMouseLeave(LocalFrame& mainFrame, const WebMouseE vent& event) | 681 void WebFrameWidgetImpl::handleMouseLeave(LocalFrame& mainFrame, const WebMouseE vent& event) |
| 649 { | 682 { |
| 650 // FIXME: WebWidget doesn't have the method below. | 683 // FIXME: WebWidget doesn't have the method below. |
| 651 // m_client->setMouseOverURL(WebURL()); | 684 // m_client->setMouseOverURL(WebURL()); |
| 652 PageWidgetEventHandler::handleMouseLeave(mainFrame, event); | 685 PageWidgetEventHandler::handleMouseLeave(mainFrame, event); |
| 653 } | 686 } |
| 654 | 687 |
| 655 void WebFrameWidgetImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEv ent& event) | 688 void WebFrameWidgetImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEv ent& event) |
| 656 { | 689 { |
| 657 // Take capture on a mouse down on a plugin so we can send it mouse events. | 690 // Take capture on a mouse down on a plugin so we can send it mouse events. |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1109 } | 1142 } |
| 1110 | 1143 |
| 1111 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p osInRootFrame) | 1144 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p osInRootFrame) |
| 1112 { | 1145 { |
| 1113 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo tFrame)); | 1146 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo tFrame)); |
| 1114 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); | 1147 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 1115 result.setToShadowHostIfInUserAgentShadowRoot(); | 1148 result.setToShadowHostIfInUserAgentShadowRoot(); |
| 1116 return result; | 1149 return result; |
| 1117 } | 1150 } |
| 1118 | 1151 |
| 1152 WebLocalFrame* WebFrameWidgetImpl::focusedWebLocalFrameInWidget() const | |
| 1153 { | |
| 1154 LocalFrame* frame = page()->focusController().focusedFrame(); | |
| 1155 return m_localRoot->frame() == frame ? WebLocalFrameImpl::fromFrame(frame) : nullptr; | |
|
kenrb
2016/06/10 20:52:03
This is wrong for a couple of reasons, I think you
EhsanK
2016/06/27 21:14:50
Yes I think I missed the frame->localFrameRoot() p
| |
| 1156 } | |
| 1157 | |
| 1119 } // namespace blink | 1158 } // namespace blink |
| OLD | NEW |