Fix content::BrowserPluginDelegate::DidResizeElement API changes.
Chromium has removed old_size in DidResizeElement interface as the 'old_size' is internal.
This commit is contained in:
parent
11ffb9dfb6
commit
0e8a585157
3 changed files with 5 additions and 11 deletions
|
@ -47,14 +47,12 @@ void GuestViewContainer::SetElementInstanceID(int element_instance_id) {
|
|||
std::make_pair(element_instance_id, this));
|
||||
}
|
||||
|
||||
void GuestViewContainer::DidResizeElement(const gfx::Size& old_size,
|
||||
const gfx::Size& new_size) {
|
||||
void GuestViewContainer::DidResizeElement(const gfx::Size& new_size) {
|
||||
if (element_resize_callback_.is_null())
|
||||
return;
|
||||
|
||||
base::MessageLoop::current()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(element_resize_callback_, old_size, new_size));
|
||||
FROM_HERE, base::Bind(element_resize_callback_, new_size));
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -16,8 +16,7 @@ namespace atom {
|
|||
|
||||
class GuestViewContainer : public content::BrowserPluginDelegate {
|
||||
public:
|
||||
typedef base::Callback<void(const gfx::Size&, const gfx::Size&)>
|
||||
ResizeCallback;
|
||||
typedef base::Callback<void(const gfx::Size&)> ResizeCallback;
|
||||
|
||||
explicit GuestViewContainer(content::RenderFrame* render_frame);
|
||||
~GuestViewContainer() override;
|
||||
|
@ -28,8 +27,7 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
|
|||
|
||||
// content::BrowserPluginDelegate:
|
||||
void SetElementInstanceID(int element_instance_id) final;
|
||||
void DidResizeElement(const gfx::Size& old_size,
|
||||
const gfx::Size& new_size) final;
|
||||
void DidResizeElement(const gfx::Size& new_size) final;
|
||||
|
||||
private:
|
||||
int element_instance_id_;
|
||||
|
|
|
@ -123,11 +123,9 @@ class WebViewImpl
|
|||
# changed.
|
||||
@dispatchEvent webViewEvent
|
||||
|
||||
onElementResize: (oldSize, newSize) ->
|
||||
onElementResize: (newSize) ->
|
||||
# Dispatch the 'resize' event.
|
||||
resizeEvent = new Event('resize', bubbles: true)
|
||||
resizeEvent.oldWidth = oldSize.width
|
||||
resizeEvent.oldHeight = oldSize.height
|
||||
resizeEvent.newWidth = newSize.width
|
||||
resizeEvent.newHeight = newSize.height
|
||||
@dispatchEvent resizeEvent
|
||||
|
|
Loading…
Add table
Reference in a new issue