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

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

Issue 2455133005: Remove FrameMsg_ClearFocusedFrame. (Closed)
Patch Set: Created 4 years, 1 month 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 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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