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

Unified Diff: chrome/renderer/resources/extensions/web_view.js

Issue 23499003: Improve <webview> autosize: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
Index: chrome/renderer/resources/extensions/web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index ff807f861df79a21e3982b30959060ad8a0837d1..4ba455362be46aee42104887ce75f51a288816cb 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -114,6 +114,11 @@ var WEB_VIEW_EXT_EVENTS = {
fields: ['processId']
},
'sizechanged': {
+ customHandler: function(webview, event, webviewEvent) {
+ webview.webviewNode_.style.width = webviewEvent.newWidth + 'px';
Fady Samuel 2013/08/27 14:16:18 Check the current bounds here to make sure we're n
lazyboy 2013/08/27 23:22:17 Done.
+ webview.webviewNode_.style.height = webviewEvent.newHeight + 'px';
+ webview.webviewNode_.dispatchEvent(webviewEvent);
+ },
evt: createEvent('webview.onSizeChanged'),
fields: ['oldHeight', 'oldWidth', 'newHeight', 'newWidth']
},

Powered by Google App Engine
This is Rietveld 408576698