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

Side by Side Diff: third_party/WebKit/Source/core/page/PointerLockController.cpp

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 29 matching lines...) Expand all
40 { 40 {
41 } 41 }
42 42
43 RawPtr<PointerLockController> PointerLockController::create(Page* page) 43 RawPtr<PointerLockController> PointerLockController::create(Page* page)
44 { 44 {
45 return new PointerLockController(page); 45 return new PointerLockController(page);
46 } 46 }
47 47
48 void PointerLockController::requestPointerLock(Element* target) 48 void PointerLockController::requestPointerLock(Element* target)
49 { 49 {
50 if (!target || !target->inDocument() || m_documentOfRemovedElementWhileWaiti ngForUnlock) { 50 if (!target || !target->inShadowIncludingDocument() || m_documentOfRemovedEl ementWhileWaitingForUnlock) {
51 enqueueEvent(EventTypeNames::pointerlockerror, target); 51 enqueueEvent(EventTypeNames::pointerlockerror, target);
52 return; 52 return;
53 } 53 }
54 54
55 UseCounter::countCrossOriginIframe(target->document(), UseCounter::ElementRe questPointerLockIframe); 55 UseCounter::countCrossOriginIframe(target->document(), UseCounter::ElementRe questPointerLockIframe);
56 56
57 if (target->document().isSandboxed(SandboxPointerLock)) { 57 if (target->document().isSandboxed(SandboxPointerLock)) {
58 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. 58 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
59 target->document().addConsoleMessage(ConsoleMessage::create(SecurityMess ageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the el ement's frame is sandboxed and the 'allow-pointer-lock' permission is not set.") ); 59 target->document().addConsoleMessage(ConsoleMessage::create(SecurityMess ageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the el ement's frame is sandboxed and the 'allow-pointer-lock' permission is not set.") );
60 enqueueEvent(EventTypeNames::pointerlockerror, target); 60 enqueueEvent(EventTypeNames::pointerlockerror, target);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 DEFINE_TRACE(PointerLockController) 162 DEFINE_TRACE(PointerLockController)
163 { 163 {
164 visitor->trace(m_page); 164 visitor->trace(m_page);
165 visitor->trace(m_element); 165 visitor->trace(m_element);
166 visitor->trace(m_documentOfRemovedElementWhileWaitingForUnlock); 166 visitor->trace(m_documentOfRemovedElementWhileWaitingForUnlock);
167 } 167 }
168 168
169 } // namespace blink 169 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698