| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "sky/engine/core/editing/HTMLInterchange.h" | 43 #include "sky/engine/core/editing/HTMLInterchange.h" |
| 44 #include "sky/engine/core/editing/InputMethodController.h" | 44 #include "sky/engine/core/editing/InputMethodController.h" |
| 45 #include "sky/engine/core/editing/TextIterator.h" | 45 #include "sky/engine/core/editing/TextIterator.h" |
| 46 #include "sky/engine/core/events/KeyboardEvent.h" | 46 #include "sky/engine/core/events/KeyboardEvent.h" |
| 47 #include "sky/engine/core/frame/FrameHost.h" | 47 #include "sky/engine/core/frame/FrameHost.h" |
| 48 #include "sky/engine/core/frame/FrameView.h" | 48 #include "sky/engine/core/frame/FrameView.h" |
| 49 #include "sky/engine/core/frame/LocalFrame.h" | 49 #include "sky/engine/core/frame/LocalFrame.h" |
| 50 #include "sky/engine/core/frame/NewEventHandler.h" | 50 #include "sky/engine/core/frame/NewEventHandler.h" |
| 51 #include "sky/engine/core/frame/Settings.h" | 51 #include "sky/engine/core/frame/Settings.h" |
| 52 #include "sky/engine/core/html/HTMLImportElement.h" | 52 #include "sky/engine/core/html/HTMLImportElement.h" |
| 53 #include "sky/engine/core/html/ime/InputMethodContext.h" | |
| 54 #include "sky/engine/core/loader/FrameLoader.h" | 53 #include "sky/engine/core/loader/FrameLoader.h" |
| 55 #include "sky/engine/core/loader/UniqueIdentifier.h" | 54 #include "sky/engine/core/loader/UniqueIdentifier.h" |
| 56 #include "sky/engine/core/page/AutoscrollController.h" | 55 #include "sky/engine/core/page/AutoscrollController.h" |
| 57 #include "sky/engine/core/page/Chrome.h" | 56 #include "sky/engine/core/page/Chrome.h" |
| 58 #include "sky/engine/core/page/EventHandler.h" | 57 #include "sky/engine/core/page/EventHandler.h" |
| 59 #include "sky/engine/core/page/FocusController.h" | 58 #include "sky/engine/core/page/FocusController.h" |
| 60 #include "sky/engine/core/page/Page.h" | 59 #include "sky/engine/core/page/Page.h" |
| 61 #include "sky/engine/core/rendering/RenderView.h" | 60 #include "sky/engine/core/rendering/RenderView.h" |
| 62 #include "sky/engine/platform/Cursor.h" | 61 #include "sky/engine/platform/Cursor.h" |
| 63 #include "sky/engine/platform/KeyboardCodes.h" | 62 #include "sky/engine/platform/KeyboardCodes.h" |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 flags |= WebTextInputFlagSpellcheckOff; | 567 flags |= WebTextInputFlagSpellcheckOff; |
| 569 | 568 |
| 570 return flags; | 569 return flags; |
| 571 } | 570 } |
| 572 | 571 |
| 573 WebString WebViewImpl::inputModeOfFocusedElement() | 572 WebString WebViewImpl::inputModeOfFocusedElement() |
| 574 { | 573 { |
| 575 return WebString(); | 574 return WebString(); |
| 576 } | 575 } |
| 577 | 576 |
| 578 InputMethodContext* WebViewImpl::inputMethodContext() | |
| 579 { | |
| 580 if (!m_imeAcceptEvents) | |
| 581 return 0; | |
| 582 | |
| 583 LocalFrame* focusedFrame = focusedCoreFrame(); | |
| 584 if (!focusedFrame) | |
| 585 return 0; | |
| 586 | |
| 587 Element* target = focusedFrame->document()->focusedElement(); | |
| 588 if (target && target->hasInputMethodContext()) | |
| 589 return &target->inputMethodContext(); | |
| 590 | |
| 591 return 0; | |
| 592 } | |
| 593 | |
| 594 void WebViewImpl::didShowCandidateWindow() | |
| 595 { | |
| 596 if (InputMethodContext* context = inputMethodContext()) | |
| 597 context->dispatchCandidateWindowShowEvent(); | |
| 598 } | |
| 599 | |
| 600 void WebViewImpl::didUpdateCandidateWindow() | |
| 601 { | |
| 602 if (InputMethodContext* context = inputMethodContext()) | |
| 603 context->dispatchCandidateWindowUpdateEvent(); | |
| 604 } | |
| 605 | |
| 606 void WebViewImpl::didHideCandidateWindow() | |
| 607 { | |
| 608 if (InputMethodContext* context = inputMethodContext()) | |
| 609 context->dispatchCandidateWindowHideEvent(); | |
| 610 } | |
| 611 | |
| 612 WebVector<WebCompositionUnderline> WebViewImpl::compositionUnderlines() const | 577 WebVector<WebCompositionUnderline> WebViewImpl::compositionUnderlines() const |
| 613 { | 578 { |
| 614 const LocalFrame* focused = focusedCoreFrame(); | 579 const LocalFrame* focused = focusedCoreFrame(); |
| 615 if (!focused) | 580 if (!focused) |
| 616 return WebVector<WebCompositionUnderline>(); | 581 return WebVector<WebCompositionUnderline>(); |
| 617 const Vector<CompositionUnderline>& underlines = focused->inputMethodControl
ler().customCompositionUnderlines(); | 582 const Vector<CompositionUnderline>& underlines = focused->inputMethodControl
ler().customCompositionUnderlines(); |
| 618 WebVector<WebCompositionUnderline> results(underlines.size()); | 583 WebVector<WebCompositionUnderline> results(underlines.size()); |
| 619 for (size_t index = 0; index < underlines.size(); ++index) { | 584 for (size_t index = 0; index < underlines.size(); ++index) { |
| 620 CompositionUnderline underline = underlines[index]; | 585 CompositionUnderline underline = underlines[index]; |
| 621 results[index] = WebCompositionUnderline(underline.startOffset, underlin
e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick, stat
ic_cast<WebColor>(underline.backgroundColor.rgb())); | 586 results[index] = WebCompositionUnderline(underline.startOffset, underlin
e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick, stat
ic_cast<WebColor>(underline.backgroundColor.rgb())); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, | 863 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, |
| 899 bool isInitialState) { | 864 bool isInitialState) { |
| 900 if (!page()) | 865 if (!page()) |
| 901 return; | 866 return; |
| 902 | 867 |
| 903 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState =
= WebPageVisibilityStateHidden); | 868 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState =
= WebPageVisibilityStateHidden); |
| 904 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>
(visibilityState)), isInitialState); | 869 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>
(visibilityState)), isInitialState); |
| 905 } | 870 } |
| 906 | 871 |
| 907 } // namespace blink | 872 } // namespace blink |
| OLD | NEW |