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

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: All tests pass 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
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 006ce49602719b6bedeaff7449c7484298cf1269..ef4416f3d44ece9017f2a8b868fd8b8f49fc446f 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,16 +71,16 @@ 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);
- GuestViewInternal.setAutoSize(this.instanceId, {
+ this.attachWindow(guestInstanceId);
+ GuestViewInternal.setAutoSize(this.guestInstanceId, {
'enableAutoSize':
this.extensionoptionsNode.hasAttribute('autosize'),
'min': {
@@ -110,7 +114,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.
@@ -118,10 +122,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),

Powered by Google App Engine
This is Rietveld 408576698