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

Unified Diff: extensions/renderer/resources/guest_view/extension_view.js

Issue 913393003: Restrict extensionview to chrome-extension:// (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/resources/guest_view/extension_view.js
diff --git a/extensions/renderer/resources/guest_view/extension_view.js b/extensions/renderer/resources/guest_view/extension_view.js
index 8ca6dfecd1feebea94c73340f3cb99f3f83d0ebb..931a5c4ec6b72a4da8a43c062ddded055903d77c 100644
--- a/extensions/renderer/resources/guest_view/extension_view.js
+++ b/extensions/renderer/resources/guest_view/extension_view.js
@@ -7,12 +7,15 @@
var GuestViewContainer = require('guestViewContainer').GuestViewContainer;
var ExtensionViewConstants =
require('extensionViewConstants').ExtensionViewConstants;
+var ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents;
var ExtensionViewInternal =
require('extensionViewInternal').ExtensionViewInternal;
function ExtensionViewImpl(extensionviewElement) {
GuestViewContainer.call(this, extensionviewElement, 'extensionview');
this.setupExtensionViewAttributes();
+
+ new ExtensionViewEvents(this, this.viewInstanceId);
}
ExtensionViewImpl.prototype.__proto__ = GuestViewContainer.prototype;
@@ -20,9 +23,7 @@ ExtensionViewImpl.prototype.__proto__ = GuestViewContainer.prototype;
ExtensionViewImpl.VIEW_TYPE = 'ExtensionView';
ExtensionViewImpl.setupElement = function(proto) {
- var apiMethods = [
- 'navigate'
- ];
+ var apiMethods = ExtensionViewImpl.getApiMethods();
GuestViewContainer.forwardApiMethods(proto, apiMethods);
};
@@ -33,10 +34,6 @@ ExtensionViewImpl.prototype.createGuest = function() {
}.bind(this));
};
-ExtensionViewImpl.prototype.onElementAttached = function() {
- this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].parse();
-};
-
ExtensionViewImpl.prototype.buildContainerParams = function() {
var params = {};
for (var i in this.attributes) {
@@ -51,13 +48,23 @@ ExtensionViewImpl.prototype.handleAttributeMutation = function(
if (!this.attributes[attributeName])
return;
- // Let the changed attribute handle its own mutation;
+ // Let the changed attribute handle its own mutation.
this.attributes[attributeName].maybeHandleMutation(oldValue, newValue);
};
ExtensionViewImpl.prototype.onElementDetached = function() {
this.guest.destroy();
- this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].reset();
+
+ // Reset all attributes.
+ for (var i in this.attributes) {
+ this.attributes[i].reset();
+ }
+};
+
+// Updates src upon loadcommit.
+ExtensionViewImpl.prototype.onLoadCommit = function(url) {
+ this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].
+ setValueIgnoreMutation(url);
};
GuestViewContainer.registerElement(ExtensionViewImpl);

Powered by Google App Engine
This is Rietveld 408576698