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

Unified Diff: ui/base/test/scoped_fake_nswindow_fullscreen.mm

Issue 1905273002: Fix positioning of Mac permission prompts when fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 4 years, 8 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
« no previous file with comments | « ui/base/test/scoped_fake_nswindow_fullscreen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/scoped_fake_nswindow_fullscreen.mm
diff --git a/ui/base/test/scoped_fake_nswindow_fullscreen.mm b/ui/base/test/scoped_fake_nswindow_fullscreen.mm
index 1fcd8949b61477e13f8684b6b1548902532d31d2..0dc9db7d262c699dba8bde548c3392d8520d37ea 100644
--- a/ui/base/test/scoped_fake_nswindow_fullscreen.mm
+++ b/ui/base/test/scoped_fake_nswindow_fullscreen.mm
@@ -14,6 +14,7 @@
#import "base/mac/sdk_forward_declarations.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
// This method exists on NSWindowDelegate on 10.7+.
// To build on 10.6, we just need to declare it somewhere. We'll test
@@ -175,6 +176,8 @@ class ScopedFakeNSWindowFullscreen::Impl {
style_as_fullscreen_ = false;
}
+ bool is_in_transition() { return is_in_transition_; }
+
private:
base::mac::ScopedObjCClassSwizzler toggle_fullscreen_swizzler_;
base::mac::ScopedObjCClassSwizzler style_mask_swizzler_;
@@ -205,6 +208,13 @@ ScopedFakeNSWindowFullscreen::~ScopedFakeNSWindowFullscreen() {
g_fake_fullscreen_impl = nullptr;
}
+void ScopedFakeNSWindowFullscreen::FinishTransition() {
+ if (impl_->is_in_transition())
+ base::RunLoop().RunUntilIdle();
+
+ DCHECK(!impl_->is_in_transition());
+}
+
} // namespace test
} // namespace ui
« no previous file with comments | « ui/base/test/scoped_fake_nswindow_fullscreen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698