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

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

Issue 334283004: Rename DOMWindow to LocalDOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/EventSource.cpp ('k') | Source/core/page/Page.cpp » ('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) 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 22 matching lines...) Expand all
33 #include "core/dom/Element.h" 33 #include "core/dom/Element.h"
34 #include "core/dom/ElementTraversal.h" 34 #include "core/dom/ElementTraversal.h"
35 #include "core/dom/NodeTraversal.h" 35 #include "core/dom/NodeTraversal.h"
36 #include "core/dom/Range.h" 36 #include "core/dom/Range.h"
37 #include "core/dom/shadow/ElementShadow.h" 37 #include "core/dom/shadow/ElementShadow.h"
38 #include "core/dom/shadow/ShadowRoot.h" 38 #include "core/dom/shadow/ShadowRoot.h"
39 #include "core/editing/Editor.h" 39 #include "core/editing/Editor.h"
40 #include "core/editing/FrameSelection.h" 40 #include "core/editing/FrameSelection.h"
41 #include "core/editing/htmlediting.h" // For firstPositionInOrBeforeNode 41 #include "core/editing/htmlediting.h" // For firstPositionInOrBeforeNode
42 #include "core/events/Event.h" 42 #include "core/events/Event.h"
43 #include "core/frame/DOMWindow.h" 43 #include "core/frame/LocalDOMWindow.h"
44 #include "core/frame/FrameView.h" 44 #include "core/frame/FrameView.h"
45 #include "core/frame/LocalFrame.h" 45 #include "core/frame/LocalFrame.h"
46 #include "core/html/HTMLAreaElement.h" 46 #include "core/html/HTMLAreaElement.h"
47 #include "core/html/HTMLImageElement.h" 47 #include "core/html/HTMLImageElement.h"
48 #include "core/html/HTMLPlugInElement.h" 48 #include "core/html/HTMLPlugInElement.h"
49 #include "core/html/HTMLShadowElement.h" 49 #include "core/html/HTMLShadowElement.h"
50 #include "core/html/HTMLTextFormControlElement.h" 50 #include "core/html/HTMLTextFormControlElement.h"
51 #include "core/page/Chrome.h" 51 #include "core/page/Chrome.h"
52 #include "core/page/ChromeClient.h" 52 #include "core/page/ChromeClient.h"
53 #include "core/page/EventHandler.h" 53 #include "core/page/EventHandler.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement()); 148 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement());
149 focusedElement->setFocus(false); 149 focusedElement->setFocus(false);
150 focusedElement->dispatchBlurEvent(0); 150 focusedElement->dispatchBlurEvent(0);
151 if (focusedElement == document->focusedElement()) { 151 if (focusedElement == document->focusedElement()) {
152 focusedElement->dispatchFocusOutEvent(EventTypeNames::focusout, 0); 152 focusedElement->dispatchFocusOutEvent(EventTypeNames::focusout, 0);
153 if (focusedElement == document->focusedElement()) 153 if (focusedElement == document->focusedElement())
154 focusedElement->dispatchFocusOutEvent(EventTypeNames::DOMFocusOu t, 0); 154 focusedElement->dispatchFocusOutEvent(EventTypeNames::DOMFocusOu t, 0);
155 } 155 }
156 } 156 }
157 157
158 if (DOMWindow* window = document->domWindow()) 158 if (LocalDOMWindow* window = document->domWindow())
159 window->dispatchEvent(Event::create(focused ? EventTypeNames::focus : Ev entTypeNames::blur)); 159 window->dispatchEvent(Event::create(focused ? EventTypeNames::focus : Ev entTypeNames::blur));
160 if (focused && document->focusedElement()) { 160 if (focused && document->focusedElement()) {
161 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement()); 161 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement());
162 focusedElement->setFocus(true); 162 focusedElement->setFocus(true);
163 focusedElement->dispatchFocusEvent(0, FocusTypePage); 163 focusedElement->dispatchFocusEvent(0, FocusTypePage);
164 if (focusedElement == document->focusedElement()) { 164 if (focusedElement == document->focusedElement()) {
165 document->focusedElement()->dispatchFocusInEvent(EventTypeNames::foc usin, 0); 165 document->focusedElement()->dispatchFocusInEvent(EventTypeNames::foc usin, 0);
166 if (focusedElement == document->focusedElement()) 166 if (focusedElement == document->focusedElement())
167 document->focusedElement()->dispatchFocusInEvent(EventTypeNames: :DOMFocusIn, 0); 167 document->focusedElement()->dispatchFocusInEvent(EventTypeNames: :DOMFocusIn, 0);
168 } 168 }
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */); 917 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */);
918 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, container); 918 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, container);
919 if (container && container->isDocumentNode()) 919 if (container && container->isDocumentNode())
920 toDocument(container)->updateLayoutIgnorePendingStylesheets(); 920 toDocument(container)->updateLayoutIgnorePendingStylesheets();
921 } while (!consumed && container); 921 } while (!consumed && container);
922 922
923 return consumed; 923 return consumed;
924 } 924 }
925 925
926 } // namespace WebCore 926 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/EventSource.cpp ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698