| Index: ui/views/cocoa/bridged_native_widget.h
|
| diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
|
| index 4a4acdefa6298d22295e548523ac62516c25969e..0378f3867e0c505d9f88d6cba9eace65556148aa 100644
|
| --- a/ui/views/cocoa/bridged_native_widget.h
|
| +++ b/ui/views/cocoa/bridged_native_widget.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #import <Cocoa/Cocoa.h>
|
|
|
| +#include <functional>
|
| #include <memory>
|
| #include <vector>
|
|
|
| @@ -184,6 +185,10 @@ class VIEWS_EXPORT BridgedNativeWidget
|
| // Sorts child NSViews according to NativeViewHosts order in views hierarchy.
|
| void ReorderChildViews();
|
|
|
| + // Schedules a draw then blocks the UI thread until the UI Compositor swaps in
|
| + // a new frame or a timeout occurs.
|
| + void PumpCompositor();
|
| +
|
| NativeWidgetMac* native_widget_mac() { return native_widget_mac_; }
|
| BridgedContentView* ns_view() { return bridged_view_; }
|
| NSWindow* ns_window() { return window_; }
|
| @@ -235,10 +240,13 @@ class VIEWS_EXPORT BridgedNativeWidget
|
| void UpdateLayerProperties();
|
|
|
| // Immediately return if there is a composited frame matching |size_in_dip|.
|
| - // Otherwise, asks ui::WindowResizeHelperMac to run tasks until a matching
|
| - // frame is ready, or a timeout occurs.
|
| + // Otherwise, calls WaitForFrame() to obtain one.
|
| void MaybeWaitForFrame(const gfx::Size& size_in_dip);
|
|
|
| + // Asks ui::WindowResizeHelperMac to run tasks until |predicate| returns true
|
| + // or |timeout_ms| passes.
|
| + void WaitForFrame(int timeout_ms, std::function<bool()> predicate);
|
| +
|
| // Show the window using -[NSApp beginSheet:..], modal for the parent window.
|
| void ShowAsModalSheet();
|
|
|
| @@ -327,6 +335,9 @@ class VIEWS_EXPORT BridgedNativeWidget
|
| // the compositor arrives to avoid "blinking".
|
| bool initial_visibility_suppressed_ = false;
|
|
|
| + // Set to true whenever a frame is swapped. Used to wait for a frame.
|
| + bool frame_swapped_ = false;
|
| +
|
| AssociatedViews associated_views_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
|
|
|