| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "core/frame/RemoteFrame.h" | 59 #include "core/frame/RemoteFrame.h" |
| 60 #include "core/frame/Settings.h" | 60 #include "core/frame/Settings.h" |
| 61 #include "core/frame/SmartClip.h" | 61 #include "core/frame/SmartClip.h" |
| 62 #include "core/frame/TopControls.h" | 62 #include "core/frame/TopControls.h" |
| 63 #include "core/html/HTMLInputElement.h" | 63 #include "core/html/HTMLInputElement.h" |
| 64 #include "core/html/HTMLMediaElement.h" | 64 #include "core/html/HTMLMediaElement.h" |
| 65 #include "core/html/HTMLPlugInElement.h" | 65 #include "core/html/HTMLPlugInElement.h" |
| 66 #include "core/html/HTMLTextAreaElement.h" | 66 #include "core/html/HTMLTextAreaElement.h" |
| 67 #include "core/html/canvas/WebGLRenderingContext.h" | 67 #include "core/html/canvas/WebGLRenderingContext.h" |
| 68 #include "core/html/forms/PopupMenuClient.h" | 68 #include "core/html/forms/PopupMenuClient.h" |
| 69 #include "core/html/ime/InputMethodContext.h" | |
| 70 #include "core/layout/LayoutPart.h" | 69 #include "core/layout/LayoutPart.h" |
| 71 #include "core/layout/LayoutView.h" | 70 #include "core/layout/LayoutView.h" |
| 72 #include "core/layout/TextAutosizer.h" | 71 #include "core/layout/TextAutosizer.h" |
| 73 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 72 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
| 74 #include "core/loader/DocumentLoader.h" | 73 #include "core/loader/DocumentLoader.h" |
| 75 #include "core/loader/FrameLoader.h" | 74 #include "core/loader/FrameLoader.h" |
| 76 #include "core/page/ContextMenuController.h" | 75 #include "core/page/ContextMenuController.h" |
| 77 #include "core/page/ContextMenuProvider.h" | 76 #include "core/page/ContextMenuProvider.h" |
| 78 #include "core/page/DragController.h" | 77 #include "core/page/DragController.h" |
| 79 #include "core/page/DragData.h" | 78 #include "core/page/DragData.h" |
| (...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2616 } | 2615 } |
| 2617 | 2616 |
| 2618 anchor = localFrame->view()->contentsToViewport(anchor); | 2617 anchor = localFrame->view()->contentsToViewport(anchor); |
| 2619 focus = localFrame->view()->contentsToViewport(focus); | 2618 focus = localFrame->view()->contentsToViewport(focus); |
| 2620 | 2619 |
| 2621 if (!selection.selection().isBaseFirst()) | 2620 if (!selection.selection().isBaseFirst()) |
| 2622 std::swap(anchor, focus); | 2621 std::swap(anchor, focus); |
| 2623 return true; | 2622 return true; |
| 2624 } | 2623 } |
| 2625 | 2624 |
| 2626 InputMethodContext* WebViewImpl::inputMethodContext() | |
| 2627 { | |
| 2628 if (!m_imeAcceptEvents) | |
| 2629 return 0; | |
| 2630 | |
| 2631 LocalFrame* focusedFrame = toLocalFrame(focusedCoreFrame()); | |
| 2632 if (!focusedFrame) | |
| 2633 return 0; | |
| 2634 | |
| 2635 Element* target = focusedFrame->document()->focusedElement(); | |
| 2636 if (target && target->hasInputMethodContext()) | |
| 2637 return &target->inputMethodContext(); | |
| 2638 | |
| 2639 return 0; | |
| 2640 } | |
| 2641 | |
| 2642 WebPlugin* WebViewImpl::focusedPluginIfInputMethodSupported(LocalFrame* frame) | 2625 WebPlugin* WebViewImpl::focusedPluginIfInputMethodSupported(LocalFrame* frame) |
| 2643 { | 2626 { |
| 2644 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame, WebNode(focusedElement())); | 2627 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame, WebNode(focusedElement())); |
| 2645 if (container && container->supportsInputMethod()) | 2628 if (container && container->supportsInputMethod()) |
| 2646 return container->plugin(); | 2629 return container->plugin(); |
| 2647 return 0; | 2630 return 0; |
| 2648 } | 2631 } |
| 2649 | 2632 |
| 2650 void WebViewImpl::didShowCandidateWindow() | |
| 2651 { | |
| 2652 if (InputMethodContext* context = inputMethodContext()) | |
| 2653 context->dispatchCandidateWindowShowEvent(); | |
| 2654 } | |
| 2655 | |
| 2656 void WebViewImpl::didUpdateCandidateWindow() | |
| 2657 { | |
| 2658 if (InputMethodContext* context = inputMethodContext()) | |
| 2659 context->dispatchCandidateWindowUpdateEvent(); | |
| 2660 } | |
| 2661 | |
| 2662 void WebViewImpl::didHideCandidateWindow() | |
| 2663 { | |
| 2664 if (InputMethodContext* context = inputMethodContext()) | |
| 2665 context->dispatchCandidateWindowHideEvent(); | |
| 2666 } | |
| 2667 | |
| 2668 bool WebViewImpl::selectionTextDirection(WebTextDirection& start, WebTextDirecti
on& end) const | 2633 bool WebViewImpl::selectionTextDirection(WebTextDirection& start, WebTextDirecti
on& end) const |
| 2669 { | 2634 { |
| 2670 const Frame* frame = focusedCoreFrame(); | 2635 const Frame* frame = focusedCoreFrame(); |
| 2671 if (!frame || frame->isRemoteFrame()) | 2636 if (!frame || frame->isRemoteFrame()) |
| 2672 return false; | 2637 return false; |
| 2673 FrameSelection& selection = toLocalFrame(frame)->selection(); | 2638 FrameSelection& selection = toLocalFrame(frame)->selection(); |
| 2674 if (!selection.toNormalizedRange()) | 2639 if (!selection.toNormalizedRange()) |
| 2675 return false; | 2640 return false; |
| 2676 start = toWebTextDirection(selection.start().primaryDirection()); | 2641 start = toWebTextDirection(selection.start().primaryDirection()); |
| 2677 end = toWebTextDirection(selection.end().primaryDirection()); | 2642 end = toWebTextDirection(selection.end().primaryDirection()); |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4503 { | 4468 { |
| 4504 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4469 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4505 } | 4470 } |
| 4506 | 4471 |
| 4507 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4472 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
| 4508 { | 4473 { |
| 4509 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4474 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
| 4510 } | 4475 } |
| 4511 | 4476 |
| 4512 } // namespace blink | 4477 } // namespace blink |
| OLD | NEW |