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

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

Issue 1026703004: Refactored extensionOptions to use the new guestViewAttributes module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment. Created 5 years, 9 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
« no previous file with comments | « extensions/renderer/resources/guest_view/web_view/web_view.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebViewImpl = require('webView').WebViewImpl; 9 var WebViewImpl = require('webView').WebViewImpl;
9 var WebViewConstants = require('webViewConstants').WebViewConstants;
10 var WebViewInternal = require('webViewInternal').WebViewInternal; 10 var WebViewInternal = require('webViewInternal').WebViewInternal;
11 11
12 // ----------------------------------------------------------------------------- 12 // -----------------------------------------------------------------------------
13 // AllowScalingAttribute object. 13 // AllowScalingAttribute object.
14 14
15 // Attribute that specifies whether scaling is allowed in the webview. 15 // Attribute that specifies whether scaling is allowed in the webview.
16 function AllowScalingAttribute(view) { 16 function AllowScalingAttribute(view) {
17 GuestViewAttributes.BooleanAttribute.call( 17 GuestViewAttributes.BooleanAttribute.call(
18 this, WebViewConstants.ATTRIBUTE_ALLOWSCALING, view); 18 this, WebViewConstants.ATTRIBUTE_ALLOWSCALING, view);
19 } 19 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 return; 246 return;
247 } 247 }
248 248
249 WebViewInternal.navigate(this.view.guest.getId(), this.getValue()); 249 WebViewInternal.navigate(this.view.guest.getId(), this.getValue());
250 }; 250 };
251 251
252 // ----------------------------------------------------------------------------- 252 // -----------------------------------------------------------------------------
253 253
254 // Sets up all of the webview attributes. 254 // Sets up all of the webview attributes.
255 WebViewImpl.prototype.setupWebViewAttributes = function() { 255 WebViewImpl.prototype.setupAttributes = function() {
256 this.attributes = {};
257
258 this.attributes[WebViewConstants.ATTRIBUTE_ALLOWSCALING] = 256 this.attributes[WebViewConstants.ATTRIBUTE_ALLOWSCALING] =
259 new AllowScalingAttribute(this); 257 new AllowScalingAttribute(this);
260 this.attributes[WebViewConstants.ATTRIBUTE_ALLOWTRANSPARENCY] = 258 this.attributes[WebViewConstants.ATTRIBUTE_ALLOWTRANSPARENCY] =
261 new AllowTransparencyAttribute(this); 259 new AllowTransparencyAttribute(this);
262 this.attributes[WebViewConstants.ATTRIBUTE_AUTOSIZE] = 260 this.attributes[WebViewConstants.ATTRIBUTE_AUTOSIZE] =
263 new AutosizeAttribute(this); 261 new AutosizeAttribute(this);
264 this.attributes[WebViewConstants.ATTRIBUTE_NAME] = 262 this.attributes[WebViewConstants.ATTRIBUTE_NAME] =
265 new NameAttribute(this); 263 new NameAttribute(this);
266 this.attributes[WebViewConstants.ATTRIBUTE_PARTITION] = 264 this.attributes[WebViewConstants.ATTRIBUTE_PARTITION] =
267 new PartitionAttribute(this); 265 new PartitionAttribute(this);
268 this.attributes[WebViewConstants.ATTRIBUTE_SRC] = 266 this.attributes[WebViewConstants.ATTRIBUTE_SRC] =
269 new SrcAttribute(this); 267 new SrcAttribute(this);
270 268
271 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT, 269 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT,
272 WebViewConstants.ATTRIBUTE_MAXWIDTH, 270 WebViewConstants.ATTRIBUTE_MAXWIDTH,
273 WebViewConstants.ATTRIBUTE_MINHEIGHT, 271 WebViewConstants.ATTRIBUTE_MINHEIGHT,
274 WebViewConstants.ATTRIBUTE_MINWIDTH]; 272 WebViewConstants.ATTRIBUTE_MINWIDTH];
275 for (var i = 0; autosizeAttributes[i]; ++i) { 273 for (var i = 0; autosizeAttributes[i]; ++i) {
276 this.attributes[autosizeAttributes[i]] = 274 this.attributes[autosizeAttributes[i]] =
277 new AutosizeDimensionAttribute(autosizeAttributes[i], this); 275 new AutosizeDimensionAttribute(autosizeAttributes[i], this);
278 } 276 }
279 }; 277 };
OLDNEW
« no previous file with comments | « extensions/renderer/resources/guest_view/web_view/web_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698