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

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

Issue 15820002: Page::chrome() should return a reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 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/page/PageConsole.cpp ('k') | Source/core/page/Settings.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) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return; 59 return;
60 } 60 }
61 61
62 if (m_element) { 62 if (m_element) {
63 if (m_element->document() != target->document()) { 63 if (m_element->document() != target->document()) {
64 enqueueEvent(eventNames().webkitpointerlockerrorEvent, target); 64 enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
65 return; 65 return;
66 } 66 }
67 enqueueEvent(eventNames().webkitpointerlockchangeEvent, target); 67 enqueueEvent(eventNames().webkitpointerlockchangeEvent, target);
68 m_element = target; 68 m_element = target;
69 } else if (m_page->chrome()->client()->requestPointerLock()) { 69 } else if (m_page->chrome().client()->requestPointerLock()) {
70 m_lockPending = true; 70 m_lockPending = true;
71 m_element = target; 71 m_element = target;
72 } else { 72 } else {
73 enqueueEvent(eventNames().webkitpointerlockerrorEvent, target); 73 enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
74 } 74 }
75 } 75 }
76 76
77 void PointerLockController::requestPointerUnlock() 77 void PointerLockController::requestPointerUnlock()
78 { 78 {
79 return m_page->chrome()->client()->requestPointerUnlock(); 79 return m_page->chrome().client()->requestPointerUnlock();
80 } 80 }
81 81
82 void PointerLockController::elementRemoved(Element* element) 82 void PointerLockController::elementRemoved(Element* element)
83 { 83 {
84 if (m_element == element) { 84 if (m_element == element) {
85 m_documentOfRemovedElementWhileWaitingForUnlock = m_element->document(); 85 m_documentOfRemovedElementWhileWaitingForUnlock = m_element->document();
86 // Set element null immediately to block any future interaction with it 86 // Set element null immediately to block any future interaction with it
87 // including mouse events received before the unlock completes. 87 // including mouse events received before the unlock completes.
88 clearElement(); 88 clearElement();
89 requestPointerUnlock(); 89 requestPointerUnlock();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 enqueueEvent(type, element->document()); 151 enqueueEvent(type, element->document());
152 } 152 }
153 153
154 void PointerLockController::enqueueEvent(const AtomicString& type, Document* doc ument) 154 void PointerLockController::enqueueEvent(const AtomicString& type, Document* doc ument)
155 { 155 {
156 if (document) 156 if (document)
157 document->enqueueDocumentEvent(Event::create(type, true, false)); 157 document->enqueueDocumentEvent(Event::create(type, true, false));
158 } 158 }
159 159
160 } // namespace WebCore 160 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/PageConsole.cpp ('k') | Source/core/page/Settings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698