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

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

Issue 847893002: Implemented explicit resizing from guestview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 // This module implements WebView (<webview>) as a custom element that wraps a 5 // This module implements WebView (<webview>) as a custom element that wraps a
6 // BrowserPlugin object element. The object element is hidden within 6 // BrowserPlugin object element. The object element is hidden within
7 // the shadow DOM of the WebView element. 7 // the shadow DOM of the WebView element.
8 8
9 var DocumentNatives = requireNative('document_natives'); 9 var DocumentNatives = requireNative('document_natives');
10 var GuestView = require('guestView').GuestView; 10 var GuestView = require('guestView').GuestView;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 var newValue = url; 208 var newValue = url;
209 if (isTopLevel && (oldValue != newValue)) { 209 if (isTopLevel && (oldValue != newValue)) {
210 // Touching the src attribute triggers a navigation. To avoid 210 // Touching the src attribute triggers a navigation. To avoid
211 // triggering a page reload on every guest-initiated navigation, 211 // triggering a page reload on every guest-initiated navigation,
212 // we do not handle this mutation. 212 // we do not handle this mutation.
213 this.attributes[WebViewConstants.ATTRIBUTE_SRC].setValueIgnoreMutation( 213 this.attributes[WebViewConstants.ATTRIBUTE_SRC].setValueIgnoreMutation(
214 newValue); 214 newValue);
215 } 215 }
216 }; 216 };
217 217
218 WebViewImpl.prototype.setSize = function(params) {
Fady Samuel 2015/01/12 23:16:40 This is fine for testing for let's not expose this
paulmeyer 2015/01/12 23:25:19 Done.
219 this.guest.setSize(params);
220 };
221
218 WebViewImpl.prototype.onAttach = function(storagePartitionId) { 222 WebViewImpl.prototype.onAttach = function(storagePartitionId) {
219 this.attributes[WebViewConstants.ATTRIBUTE_PARTITION].setValue( 223 this.attributes[WebViewConstants.ATTRIBUTE_PARTITION].setValue(
220 storagePartitionId); 224 storagePartitionId);
221 }; 225 };
222 226
223 WebViewImpl.prototype.buildAttachParams = function() { 227 WebViewImpl.prototype.buildAttachParams = function() {
224 var params = { 'userAgentOverride': this.userAgentOverride }; 228 var params = { 'userAgentOverride': this.userAgentOverride };
225 for (var i in this.attributes) { 229 for (var i in this.attributes) {
226 params[i] = this.attributes[i].getValue(); 230 params[i] = this.attributes[i].getValue();
227 } 231 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 WebViewImpl.prototype.setupExperimentalContextMenus = function() {}; 272 WebViewImpl.prototype.setupExperimentalContextMenus = function() {};
269 WebViewImpl.prototype.maybeSetupExperimentalChromeWebViewEvents = 273 WebViewImpl.prototype.maybeSetupExperimentalChromeWebViewEvents =
270 function(request) { 274 function(request) {
271 return request; 275 return request;
272 }; 276 };
273 277
274 GuestViewContainer.registerElement(WebViewImpl); 278 GuestViewContainer.registerElement(WebViewImpl);
275 279
276 // Exports. 280 // Exports.
277 exports.WebViewImpl = WebViewImpl; 281 exports.WebViewImpl = WebViewImpl;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698