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

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

Issue 1017863007: Refactored the attributes modules of extension_view and web_view into guest_view_attributes.js. (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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 ExtensionView <extensionview>. 5 // This module implements the ExtensionView <extensionview>.
6 6
7 var GuestViewContainer = require('guestViewContainer').GuestViewContainer; 7 var GuestViewContainer = require('guestViewContainer').GuestViewContainer;
8 var ExtensionViewConstants = 8 var ExtensionViewConstants =
9 require('extensionViewConstants').ExtensionViewConstants; 9 require('extensionViewConstants').ExtensionViewConstants;
10 var ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents; 10 var ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // Let the changed attribute handle its own mutation. 51 // Let the changed attribute handle its own mutation.
52 this.attributes[attributeName].maybeHandleMutation(oldValue, newValue); 52 this.attributes[attributeName].maybeHandleMutation(oldValue, newValue);
53 }; 53 };
54 54
55 ExtensionViewImpl.prototype.onElementDetached = function() { 55 ExtensionViewImpl.prototype.onElementDetached = function() {
56 this.guest.destroy(); 56 this.guest.destroy();
57 57
58 // Reset all attributes. 58 // Reset all attributes.
59 for (var i in this.attributes) { 59 for (var i in this.attributes) {
60 this.attributes[i].reset(); 60 this.attributes[i].setValueIgnoreMutation();
61 } 61 }
62 }; 62 };
63 63
64 // Updates src upon loadcommit. 64 // Updates src upon loadcommit.
65 ExtensionViewImpl.prototype.onLoadCommit = function(url) { 65 ExtensionViewImpl.prototype.onLoadCommit = function(url) {
66 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC]. 66 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].
67 setValueIgnoreMutation(url); 67 setValueIgnoreMutation(url);
68 }; 68 };
69 69
70 GuestViewContainer.registerElement(ExtensionViewImpl); 70 GuestViewContainer.registerElement(ExtensionViewImpl);
71 71
72 // Exports. 72 // Exports.
73 exports.ExtensionViewImpl = ExtensionViewImpl; 73 exports.ExtensionViewImpl = ExtensionViewImpl;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698