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

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

Issue 845363004: <webview>, <appview> and <extensionoptions> can run in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 11 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/app_view.js
diff --git a/extensions/renderer/resources/guest_view/app_view.js b/extensions/renderer/resources/guest_view/app_view.js
index 4c29e9f5a4d540841a671c0e006b477c33d09e74..17f142ba70618a92e6656994cd652676d6ee98a9 100644
--- a/extensions/renderer/resources/guest_view/app_view.js
+++ b/extensions/renderer/resources/guest_view/app_view.js
@@ -9,6 +9,9 @@ var IdGenerator = requireNative('id_generator');
function AppViewImpl(appviewElement) {
GuestViewContainer.call(this, appviewElement, 'appview');
+
+ this.app = '';
+ this.data = '';
}
AppViewImpl.prototype.__proto__ = GuestViewContainer.prototype;
@@ -39,6 +42,13 @@ AppViewImpl.prototype.getErrorNode = function() {
return this.errorNode;
};
+AppViewImpl.prototype.buildContainerParams = function() {
+ return {
+ 'appId': this.app,
+ 'data': this.data || {}
+ };
+};
+
AppViewImpl.prototype.connect = function(app, data, callback) {
if (!this.elementAttached) {
if (callback) {
@@ -46,13 +56,12 @@ AppViewImpl.prototype.connect = function(app, data, callback) {
}
return;
}
- var createParams = {
- 'appId': app,
- 'data': data || {}
- };
+
+ this.app = app;
+ this.data = data;
this.guest.destroy();
- this.guest.create(createParams, function() {
+ this.guest.create(this.buildParams(), function() {
if (!this.guest.getId()) {
var errorMsg = 'Unable to connect to app "' + app + '".';
window.console.warn(errorMsg);
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.cc ('k') | extensions/renderer/resources/guest_view/guest_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698