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

Side by Side Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 2592823003: Replace the remaining DOMWindowProperty with ContextClient (Closed)
Patch Set: Created 4 years 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/screen_orientation/ScreenOrientation.h" 5 #include "modules/screen_orientation/ScreenOrientation.h"
6 6
7 #include "bindings/core/v8/ScriptPromise.h" 7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // created when the LocalFrame is created so we shouldn't be in that 108 // created when the LocalFrame is created so we shouldn't be in that
109 // situation. 109 // situation.
110 // In order to create the ScreenOrientationController lazily, we would need 110 // In order to create the ScreenOrientationController lazily, we would need
111 // to be able to access WebFrameClient from modules/. 111 // to be able to access WebFrameClient from modules/.
112 112
113 orientation->controller()->setOrientation(orientation); 113 orientation->controller()->setOrientation(orientation);
114 return orientation; 114 return orientation;
115 } 115 }
116 116
117 ScreenOrientation::ScreenOrientation(LocalFrame* frame) 117 ScreenOrientation::ScreenOrientation(LocalFrame* frame)
118 : DOMWindowProperty(frame), 118 : ContextClient(frame), m_type(WebScreenOrientationUndefined), m_angle(0) {}
119 m_type(WebScreenOrientationUndefined),
120 m_angle(0) {}
121 119
122 ScreenOrientation::~ScreenOrientation() {} 120 ScreenOrientation::~ScreenOrientation() {}
123 121
124 const WTF::AtomicString& ScreenOrientation::interfaceName() const { 122 const WTF::AtomicString& ScreenOrientation::interfaceName() const {
125 return EventTargetNames::ScreenOrientation; 123 return EventTargetNames::ScreenOrientation;
126 } 124 }
127 125
128 ExecutionContext* ScreenOrientation::getExecutionContext() const { 126 ExecutionContext* ScreenOrientation::getExecutionContext() const {
129 if (!frame()) 127 if (!frame())
130 return 0; 128 return 0;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 182
185 ScreenOrientationControllerImpl* ScreenOrientation::controller() { 183 ScreenOrientationControllerImpl* ScreenOrientation::controller() {
186 if (!frame()) 184 if (!frame())
187 return 0; 185 return 0;
188 186
189 return ScreenOrientationControllerImpl::from(*frame()); 187 return ScreenOrientationControllerImpl::from(*frame());
190 } 188 }
191 189
192 DEFINE_TRACE(ScreenOrientation) { 190 DEFINE_TRACE(ScreenOrientation) {
193 EventTargetWithInlineData::trace(visitor); 191 EventTargetWithInlineData::trace(visitor);
194 DOMWindowProperty::trace(visitor); 192 ContextClient::trace(visitor);
195 } 193 }
196 194
197 } // namespace blink 195 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698