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

Unified Diff: third_party/WebKit/Source/platform/ScopedOrientationChangeIndicator.cpp

Issue 2175863002: Allow going fullscreen during a screen orientation change handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/ScopedOrientationChangeIndicator.cpp
diff --git a/third_party/WebKit/Source/platform/ScopedOrientationChangeIndicator.cpp b/third_party/WebKit/Source/platform/ScopedOrientationChangeIndicator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..50cc22d0be18eaca631ea9acf68e6b9eeebe6cf3
--- /dev/null
+++ b/third_party/WebKit/Source/platform/ScopedOrientationChangeIndicator.cpp
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/ScopedOrientationChangeIndicator.h"
+
+#include "wtf/Assertions.h"
+
+namespace blink {
+
+ScopedOrientationChangeIndicator::State ScopedOrientationChangeIndicator::s_state = ScopedOrientationChangeIndicator::State::NotProcessing;
+
+ScopedOrientationChangeIndicator::ScopedOrientationChangeIndicator()
+{
+ DCHECK(isMainThread());
+
+ m_previousState = s_state;
+ s_state = State::Processing;
+}
+
+ScopedOrientationChangeIndicator::~ScopedOrientationChangeIndicator()
+{
+ DCHECK(isMainThread());
+ s_state = m_previousState;
+}
+
+// static
+bool ScopedOrientationChangeIndicator::processingOrientationChange()
+{
+ DCHECK(isMainThread());
+ return s_state == State::Processing;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698