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

Unified Diff: chrome/renderer/resources/extensions/extension_options.js

Issue 444813002: Remove BrowserPlugin's -internal-attach method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't crash on tear down Created 6 years, 4 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
« no previous file with comments | « chrome/renderer/resources/extensions/app_view.js ('k') | chrome/renderer/resources/extensions/web_view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/extension_options.js
diff --git a/chrome/renderer/resources/extensions/extension_options.js b/chrome/renderer/resources/extensions/extension_options.js
index d88c3d1460a5bd490e6ba0ba423f1c3f03bf0863..b3adb0b609727648b85b579289292250737fe001 100644
--- a/chrome/renderer/resources/extensions/extension_options.js
+++ b/chrome/renderer/resources/extensions/extension_options.js
@@ -9,6 +9,7 @@ var GuestViewInternal =
require('binding').Binding.create('guestViewInternal').generate();
var IdGenerator = requireNative('id_generator');
var utils = require('utils');
+var guestViewInternalNatives = requireNative('guest_view_internal');
// Mapping of the autosize attribute names to default values
var AUTO_SIZE_ATTRIBUTES = {
@@ -41,8 +42,8 @@ function ExtensionOptionsInternal(extensionoptionsNode) {
this.init();
};
-ExtensionOptionsInternal.prototype.attachWindow = function(instanceId) {
- this.instanceId = instanceId;
+ExtensionOptionsInternal.prototype.attachWindow = function(guestInstanceId) {
+ this.guestInstanceId = guestInstanceId;
var params = {
'autosize': this.autosize,
'instanceId': this.viewInstanceId,
@@ -50,8 +51,11 @@ ExtensionOptionsInternal.prototype.attachWindow = function(instanceId) {
'maxwidth': parseInt(this.maxwidth || 0),
'minheight': parseInt(this.minheight || 0),
'minwidth': parseInt(this.minwidth || 0)
- }
- return this.browserPluginNode['-internal-attach'](instanceId, params);
+ };
+ return guestViewInternalNatives.AttachGuest(
+ parseInt(this.browserPluginNode.getAttribute('internalinstanceid')),
+ guestInstanceId,
+ params);
};
ExtensionOptionsInternal.prototype.createBrowserPluginNode = function() {
@@ -67,15 +71,15 @@ ExtensionOptionsInternal.prototype.createGuest = function() {
GuestViewInternal.createGuest(
'extensionoptions',
params,
- function(instanceId) {
- if (instanceId == 0) {
+ function(guestInstanceId) {
+ if (guestInstanceId == 0) {
// Fire a createfailed event here rather than in ExtensionOptionsGuest
// because the guest will not be created, and cannot fire an event.
this.initCalled = false;
var createFailedEvent = new Event('createfailed', { bubbles: true });
this.dispatchEvent(createFailedEvent);
} else {
- this.attachWindow(instanceId);
+ this.attachWindow(guestInstanceId);
}
}.bind(this));
};
@@ -98,7 +102,7 @@ ExtensionOptionsInternal.prototype.handleExtensionOptionsAttributeMutation =
if (name == 'extension') {
this.extensionId = newValue;
// Create new guest view if one hasn't been created for this element.
- if (!this.instanceId && this.parseExtensionAttribute())
+ if (!this.guestInstanceId && this.parseExtensionAttribute())
this.init();
// TODO(ericzeng): Implement navigation to another guest view if we want
// that functionality.
@@ -106,10 +110,10 @@ ExtensionOptionsInternal.prototype.handleExtensionOptionsAttributeMutation =
this[name] = newValue;
this.resetSizeConstraintsIfInvalid();
- if (!this.instanceId)
+ if (!this.guestInstanceId)
return;
- GuestViewInternal.setAutoSize(this.instanceId, {
+ GuestViewInternal.setAutoSize(this.guestInstanceId, {
'enableAutoSize': this.extensionoptionsNode.hasAttribute('autosize'),
'min': {
'width': parseInt(this.minwidth || 0),
« no previous file with comments | « chrome/renderer/resources/extensions/app_view.js ('k') | chrome/renderer/resources/extensions/web_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698