Delay the call of element resize callback to next tick

This commit is contained in:
Cheng Zhao 2015-08-10 11:56:42 +08:00
parent eaaf52483e
commit 0a49dcc623

View file

@ -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