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

Side by Side Diff: Source/core/page/FocusController.cpp

Issue 809523003: Send NPAPI focus messages when web contents is blurred or focused (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: setFocus call update Created 5 years, 10 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 | « Source/core/html/HTMLPlugInElement.cpp ('k') | no next file » | 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) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 ASSERT(isShadowInsertionPointFocusScopeOwner(shadowInsertionPoint)); 146 ASSERT(isShadowInsertionPointFocusScopeOwner(shadowInsertionPoint));
147 return FocusNavigationScope(shadowInsertionPoint.olderShadowRoot()); 147 return FocusNavigationScope(shadowInsertionPoint.olderShadowRoot());
148 } 148 }
149 149
150 static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused) 150 static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused)
151 { 151 {
152 // If we have a focused node we should dispatch blur on it before we blur th e window. 152 // If we have a focused node we should dispatch blur on it before we blur th e window.
153 // If we have a focused node we should dispatch focus on it after we focus t he window. 153 // If we have a focused node we should dispatch focus on it after we focus t he window.
154 // https://bugs.webkit.org/show_bug.cgi?id=27105 154 // https://bugs.webkit.org/show_bug.cgi?id=27105
155 155
156 if (document->focusedElement() && isHTMLPlugInElement(document->focusedEleme nt()))
157 toHTMLPlugInElement(document->focusedElement())->setPluginFocus(focused) ;
158
156 // Do not fire events while modal dialogs are up. See https://bugs.webkit.o rg/show_bug.cgi?id=33962 159 // Do not fire events while modal dialogs are up. See https://bugs.webkit.o rg/show_bug.cgi?id=33962
157 if (Page* page = document->page()) { 160 if (Page* page = document->page()) {
158 if (page->defersLoading()) 161 if (page->defersLoading())
159 return; 162 return;
160 } 163 }
161 164
162 if (!focused && document->focusedElement()) { 165 if (!focused && document->focusedElement()) {
163 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement()); 166 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement());
164 focusedElement->setFocus(false); 167 focusedElement->setFocus(false);
165 focusedElement->dispatchBlurEvent(nullptr); 168 focusedElement->dispatchBlurEvent(nullptr);
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 return consumed; 941 return consumed;
939 } 942 }
940 943
941 void FocusController::trace(Visitor* visitor) 944 void FocusController::trace(Visitor* visitor)
942 { 945 {
943 visitor->trace(m_page); 946 visitor->trace(m_page);
944 visitor->trace(m_focusedFrame); 947 visitor->trace(m_focusedFrame);
945 } 948 }
946 949
947 } // namespace blink 950 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLPlugInElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698