Delay the call of element resize callback to next tick
This commit is contained in:
parent
eaaf52483e
commit
0a49dcc623
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "base/lazy_instance.h"
|
#include "base/lazy_instance.h"
|
||||||
|
#include "ui/gfx/geometry/size.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -51,7 +52,9 @@ void GuestViewContainer::DidResizeElement(const gfx::Size& old_size,
|
||||||
if (element_resize_callback_.is_null())
|
if (element_resize_callback_.is_null())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
element_resize_callback_.Run(old_size, new_size);
|
base::MessageLoop::current()->PostTask(
|
||||||
|
FROM_HERE,
|
||||||
|
base::Bind(element_resize_callback_, old_size, new_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
Loading…
Reference in a new issue