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

Side by Side 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, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Shim that simulates a <webview> tag via Mutation Observers. 5 // Shim that simulates a <webview> tag via Mutation Observers.
6 // 6 //
7 // The actual tag is implemented via the browser plugin. The internals of this 7 // The actual tag is implemented via the browser plugin. The internals of this
8 // are hidden via Shadow DOM. 8 // are hidden via Shadow DOM.
9 9
10 'use strict'; 10 'use strict';
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 'requestMethod', 107 'requestMethod',
108 'url', 108 'url',
109 'userGesture' 109 'userGesture'
110 ] 110 ]
111 }, 111 },
112 'responsive': { 112 'responsive': {
113 evt: createEvent('webview.onResponsive'), 113 evt: createEvent('webview.onResponsive'),
114 fields: ['processId'] 114 fields: ['processId']
115 }, 115 },
116 'sizechanged': { 116 'sizechanged': {
117 customHandler: function(webview, event, webviewEvent) {
118 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.
119 webview.webviewNode_.style.height = webviewEvent.newHeight + 'px';
120 webview.webviewNode_.dispatchEvent(webviewEvent);
121 },
117 evt: createEvent('webview.onSizeChanged'), 122 evt: createEvent('webview.onSizeChanged'),
118 fields: ['oldHeight', 'oldWidth', 'newHeight', 'newWidth'] 123 fields: ['oldHeight', 'oldWidth', 'newHeight', 'newWidth']
119 }, 124 },
120 'unresponsive': { 125 'unresponsive': {
121 evt: createEvent('webview.onUnresponsive'), 126 evt: createEvent('webview.onUnresponsive'),
122 fields: ['processId'] 127 fields: ['processId']
123 } 128 }
124 }; 129 };
125 130
126 // Implemented when the experimental API is available. 131 // Implemented when the experimental API is available.
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 809
805 /** 810 /**
806 * Implemented when the experimental API is available. 811 * Implemented when the experimental API is available.
807 * @private 812 * @private
808 */ 813 */
809 WebViewInternal.prototype.maybeAttachWebRequestEventToWebview_ = function() {}; 814 WebViewInternal.prototype.maybeAttachWebRequestEventToWebview_ = function() {};
810 815
811 exports.webView = webView; 816 exports.webView = webView;
812 exports.WebViewInternal = WebViewInternal; 817 exports.WebViewInternal = WebViewInternal;
813 exports.CreateEvent = createEvent; 818 exports.CreateEvent = createEvent;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698