| 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 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2859 | 2859 |
| 2860 void WebViewImpl::focusDocumentView(WebFrame* frame) { | 2860 void WebViewImpl::focusDocumentView(WebFrame* frame) { |
| 2861 // This is currently only used when replicating focus changes for | 2861 // This is currently only used when replicating focus changes for |
| 2862 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending | 2862 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending |
| 2863 // duplicate frameFocused updates from FocusController to the browser | 2863 // duplicate frameFocused updates from FocusController to the browser |
| 2864 // process, which already knows the latest focused frame. | 2864 // process, which already knows the latest focused frame. |
| 2865 page()->focusController().focusDocumentView(frame->toImplBase()->frame(), | 2865 page()->focusController().focusDocumentView(frame->toImplBase()->frame(), |
| 2866 false /* notifyEmbedder */); | 2866 false /* notifyEmbedder */); |
| 2867 } | 2867 } |
| 2868 | 2868 |
| 2869 void WebViewImpl::unfocusDocumentView() { | |
| 2870 page()->focusController().focusDocumentView(nullptr /* frame */, | |
| 2871 false /* notifyEmbedder */); | |
| 2872 } | |
| 2873 | |
| 2874 void WebViewImpl::setInitialFocus(bool reverse) { | 2869 void WebViewImpl::setInitialFocus(bool reverse) { |
| 2875 if (!m_page) | 2870 if (!m_page) |
| 2876 return; | 2871 return; |
| 2877 Frame* frame = page()->focusController().focusedOrMainFrame(); | 2872 Frame* frame = page()->focusController().focusedOrMainFrame(); |
| 2878 if (frame->isLocalFrame()) { | 2873 if (frame->isLocalFrame()) { |
| 2879 if (Document* document = toLocalFrame(frame)->document()) | 2874 if (Document* document = toLocalFrame(frame)->document()) |
| 2880 document->clearFocusedElement(); | 2875 document->clearFocusedElement(); |
| 2881 } | 2876 } |
| 2882 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward | 2877 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward |
| 2883 : WebFocusTypeForward); | 2878 : WebFocusTypeForward); |
| (...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4552 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4547 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4553 return nullptr; | 4548 return nullptr; |
| 4554 return focusedFrame; | 4549 return focusedFrame; |
| 4555 } | 4550 } |
| 4556 | 4551 |
| 4557 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4552 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4558 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4553 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4559 } | 4554 } |
| 4560 | 4555 |
| 4561 } // namespace blink | 4556 } // namespace blink |
| OLD | NEW |