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

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

Issue 2273193003: Remove a redundant frame check in ScreenOrientation::isActiveAndVisible (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ScreenOrientationController.h" 5 #include "modules/screen_orientation/ScreenOrientationController.h"
6 6
7 #include "core/events/Event.h" 7 #include "core/events/Event.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 orientationType = computeOrientation(chromeClient.screenInfo().rect, scr eenInfo.orientationAngle); 86 orientationType = computeOrientation(chromeClient.screenInfo().rect, scr eenInfo.orientationAngle);
87 } 87 }
88 ASSERT(orientationType != WebScreenOrientationUndefined); 88 ASSERT(orientationType != WebScreenOrientationUndefined);
89 89
90 m_orientation->setType(orientationType); 90 m_orientation->setType(orientationType);
91 m_orientation->setAngle(screenInfo.orientationAngle); 91 m_orientation->setAngle(screenInfo.orientationAngle);
92 } 92 }
93 93
94 bool ScreenOrientationController::isActiveAndVisible() const 94 bool ScreenOrientationController::isActiveAndVisible() const
95 { 95 {
96 return m_orientation && m_client && frame() && page() && page()->isPageVisib le(); 96 return m_orientation && m_client && page() && page()->isPageVisible();
97 } 97 }
98 98
99 void ScreenOrientationController::pageVisibilityChanged() 99 void ScreenOrientationController::pageVisibilityChanged()
100 { 100 {
101 notifyDispatcher(); 101 notifyDispatcher();
102 102
103 if (!isActiveAndVisible()) 103 if (!isActiveAndVisible())
104 return; 104 return;
105 105
106 DCHECK(frame()); 106 DCHECK(frame());
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 DEFINE_TRACE(ScreenOrientationController) 215 DEFINE_TRACE(ScreenOrientationController)
216 { 216 {
217 visitor->trace(m_orientation); 217 visitor->trace(m_orientation);
218 DOMWindowProperty::trace(visitor); 218 DOMWindowProperty::trace(visitor);
219 Supplement<LocalFrame>::trace(visitor); 219 Supplement<LocalFrame>::trace(visitor);
220 PlatformEventController::trace(visitor); 220 PlatformEventController::trace(visitor);
221 } 221 }
222 222
223 } // namespace blink 223 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698