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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 279313003: Create Document exitPointerLock and pointerLockElement API methods. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge Created 6 years, 7 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/dom/Document.h ('k') | Source/core/dom/Document.idl » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5060 matching lines...) Expand 10 before | Expand all | Expand 10 after
5071 element->setIsInTopLayer(false); 5071 element->setIsInTopLayer(false);
5072 } 5072 }
5073 5073
5074 HTMLDialogElement* Document::activeModalDialog() const 5074 HTMLDialogElement* Document::activeModalDialog() const
5075 { 5075 {
5076 if (m_topLayerElements.isEmpty()) 5076 if (m_topLayerElements.isEmpty())
5077 return 0; 5077 return 0;
5078 return toHTMLDialogElement(m_topLayerElements.last().get()); 5078 return toHTMLDialogElement(m_topLayerElements.last().get());
5079 } 5079 }
5080 5080
5081 void Document::webkitExitPointerLock() 5081 void Document::exitPointerLock()
5082 { 5082 {
5083 if (!page()) 5083 if (!page())
5084 return; 5084 return;
5085 if (Element* target = page()->pointerLockController().element()) { 5085 if (Element* target = page()->pointerLockController().element()) {
5086 if (target->document() != this) 5086 if (target->document() != this)
5087 return; 5087 return;
5088 } 5088 }
5089 page()->pointerLockController().requestPointerUnlock(); 5089 page()->pointerLockController().requestPointerUnlock();
5090 } 5090 }
5091 5091
5092 Element* Document::webkitPointerLockElement() const 5092 Element* Document::pointerLockElement() const
5093 { 5093 {
5094 if (!page() || page()->pointerLockController().lockPending()) 5094 if (!page() || page()->pointerLockController().lockPending())
5095 return 0; 5095 return 0;
5096 if (Element* element = page()->pointerLockController().element()) { 5096 if (Element* element = page()->pointerLockController().element()) {
5097 if (element->document() == this) 5097 if (element->document() == this)
5098 return element; 5098 return element;
5099 } 5099 }
5100 return 0; 5100 return 0;
5101 } 5101 }
5102 5102
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
5730 visitor->trace(m_userActionElements); 5730 visitor->trace(m_userActionElements);
5731 visitor->trace(m_svgExtensions); 5731 visitor->trace(m_svgExtensions);
5732 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5732 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5733 DocumentSupplementable::trace(visitor); 5733 DocumentSupplementable::trace(visitor);
5734 TreeScope::trace(visitor); 5734 TreeScope::trace(visitor);
5735 ContainerNode::trace(visitor); 5735 ContainerNode::trace(visitor);
5736 ExecutionContext::trace(visitor); 5736 ExecutionContext::trace(visitor);
5737 } 5737 }
5738 5738
5739 } // namespace WebCore 5739 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698