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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nasko@ comments. Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebView.h » ('j') | 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) 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 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 2957
2958 void WebViewImpl::focusDocumentView(WebFrame* frame) 2958 void WebViewImpl::focusDocumentView(WebFrame* frame)
2959 { 2959 {
2960 // This is currently only used when replicating focus changes for 2960 // This is currently only used when replicating focus changes for
2961 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending 2961 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending
2962 // duplicate frameFocused updates from FocusController to the browser 2962 // duplicate frameFocused updates from FocusController to the browser
2963 // process, which already knows the latest focused frame. 2963 // process, which already knows the latest focused frame.
2964 page()->focusController().focusDocumentView(frame->toImplBase()->frame(), fa lse /* notifyEmbedder */); 2964 page()->focusController().focusDocumentView(frame->toImplBase()->frame(), fa lse /* notifyEmbedder */);
2965 } 2965 }
2966 2966
2967 void WebViewImpl::unfocusDocumentView()
2968 {
2969 page()->focusController().focusDocumentView(nullptr /* frame */, false /* no tifyEmbedder */);
2970 }
2971
2967 void WebViewImpl::setInitialFocus(bool reverse) 2972 void WebViewImpl::setInitialFocus(bool reverse)
2968 { 2973 {
2969 if (!m_page) 2974 if (!m_page)
2970 return; 2975 return;
2971 Frame* frame = page()->focusController().focusedOrMainFrame(); 2976 Frame* frame = page()->focusController().focusedOrMainFrame();
2972 if (frame->isLocalFrame()) { 2977 if (frame->isLocalFrame()) {
2973 if (Document* document = toLocalFrame(frame)->document()) 2978 if (Document* document = toLocalFrame(frame)->document())
2974 document->clearFocusedElement(); 2979 document->clearFocusedElement();
2975 } 2980 }
2976 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W ebFocusTypeForward); 2981 page()->focusController().setInitialFocus(reverse ? WebFocusTypeBackward : W ebFocusTypeForward);
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
4616 return nullptr; 4621 return nullptr;
4617 return focusedFrame; 4622 return focusedFrame;
4618 } 4623 }
4619 4624
4620 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4625 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4621 { 4626 {
4622 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4627 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4623 } 4628 }
4624 4629
4625 } // namespace blink 4630 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698