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

Side by Side Diff: extensions/renderer/resources/guest_view/web_view/web_view_attributes.js

Issue 1033373003: GuestView: Lazily push attributes to the browser process on attach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_sizing
Patch Set: Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This module implements the attributes of the <webview> tag. 5 // This module implements the attributes of the <webview> tag.
6 6
7 var GuestViewAttributes = require('guestViewAttributes').GuestViewAttributes; 7 var GuestViewAttributes = require('guestViewAttributes').GuestViewAttributes;
8 var WebViewConstants = require('webViewConstants').WebViewConstants; 8 var WebViewConstants = require('webViewConstants').WebViewConstants;
9 var WebViewImpl = require('webView').WebViewImpl; 9 var WebViewImpl = require('webView').WebViewImpl;
10 var WebViewInternal = require('webViewInternal').WebViewInternal; 10 var WebViewInternal = require('webViewInternal').WebViewInternal;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // src attribute changes normally initiate a navigation. We suppress 192 // src attribute changes normally initiate a navigation. We suppress
193 // the next src attribute handler call to avoid reloading the page 193 // the next src attribute handler call to avoid reloading the page
194 // on every guest-initiated navigation. 194 // on every guest-initiated navigation.
195 this.setValueIgnoreMutation(oldValue); 195 this.setValueIgnoreMutation(oldValue);
196 return; 196 return;
197 } 197 }
198 this.parse(); 198 this.parse();
199 }; 199 };
200 200
201 SrcAttribute.prototype.attach = function() { 201 SrcAttribute.prototype.attach = function() {
202 GuestViewAttributes.Attribute.prototype.attach.call(this);
paulmeyer 2015/03/27 22:40:40 Why are these calls to the base attach/detach need
Fady Samuel 2015/03/27 22:56:36 They're unnecessary. They're remnants from an olde
202 this.parse(); 203 this.parse();
203 }; 204 };
204 205
205 SrcAttribute.prototype.detach = function() { 206 SrcAttribute.prototype.detach = function() {
207 GuestViewAttributes.Attribute.prototype.detach.call(this);
paulmeyer 2015/03/27 22:40:40 See above.
Fady Samuel 2015/03/27 22:56:36 Done.
206 this.beforeFirstNavigation = true; 208 this.beforeFirstNavigation = true;
207 }; 209 };
208 210
209 // The purpose of this mutation observer is to catch assignment to the src 211 // The purpose of this mutation observer is to catch assignment to the src
210 // attribute without any changes to its value. This is useful in the case 212 // attribute without any changes to its value. This is useful in the case
211 // where the webview guest has crashed and navigating to the same address 213 // where the webview guest has crashed and navigating to the same address
212 // spawns off a new process. 214 // spawns off a new process.
213 SrcAttribute.prototype.setupMutationObserver = 215 SrcAttribute.prototype.setupMutationObserver =
214 function() { 216 function() {
215 this.observer = new MutationObserver(function(mutations) { 217 this.observer = new MutationObserver(function(mutations) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 270
269 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT, 271 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT,
270 WebViewConstants.ATTRIBUTE_MAXWIDTH, 272 WebViewConstants.ATTRIBUTE_MAXWIDTH,
271 WebViewConstants.ATTRIBUTE_MINHEIGHT, 273 WebViewConstants.ATTRIBUTE_MINHEIGHT,
272 WebViewConstants.ATTRIBUTE_MINWIDTH]; 274 WebViewConstants.ATTRIBUTE_MINWIDTH];
273 for (var i = 0; autosizeAttributes[i]; ++i) { 275 for (var i = 0; autosizeAttributes[i]; ++i) {
274 this.attributes[autosizeAttributes[i]] = 276 this.attributes[autosizeAttributes[i]] =
275 new AutosizeDimensionAttribute(autosizeAttributes[i], this); 277 new AutosizeDimensionAttribute(autosizeAttributes[i], this);
276 } 278 }
277 }; 279 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698