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

Unified Diff: Source/core/html/shadow/PluginPlaceholderElement.js

Issue 740063002: Move creation of plugin placeholder DOM from JS to C++. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: oilpan Created 6 years, 1 month 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 | « Source/core/html/shadow/PluginPlaceholderElement.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/PluginPlaceholderElement.js
diff --git a/Source/core/html/shadow/PluginPlaceholderElement.js b/Source/core/html/shadow/PluginPlaceholderElement.js
index 056cfbfa48dbffda4c31445ceb9594c6df849315..fe3581e379648b1d803c09767f02004e509adb05 100644
--- a/Source/core/html/shadow/PluginPlaceholderElement.js
+++ b/Source/core/html/shadow/PluginPlaceholderElement.js
@@ -5,54 +5,6 @@
'use strict';
installClass('PluginPlaceholderElement', function(PluginPlaceholderElementPrototype) {
- // FIXME: Load this from a .css file.
- var styleSource =
- '#plugin-placeholder {' +
- ' all: initial;' +
- ' width: 100%;' +
- ' height: 100%;' +
- ' overflow: hidden;' +
- ' display: flex;' +
- ' align-items: center;' +
- ' background: gray;' +
- ' font: 12px -webkit-control;' +
- '}' +
- '#plugin-placeholder-content {' +
- ' text-align: center;' +
- ' margin: auto;' +
- '}';
-
- PluginPlaceholderElementPrototype.createdCallback = function() {
- this.id = 'plugin-placeholder';
-
- var styleElement = document.createElement('style');
- styleElement.textContent = styleSource;
-
- var contentElement = document.createElement('div');
- contentElement.id = 'plugin-placeholder-content';
-
- var messageElement = document.createElement('div');
- messageElement.id = 'plugin-placeholder-message';
-
- // FIXME: UI polish, l10n, etc. for the close button.
- var closeButton = document.createElement('button');
- closeButton.id = 'plugin-placeholder-close-button';
- closeButton.textContent = 'Close';
- closeButton.style.display = 'none';
- closeButton.addEventListener('click', function() {
- // FIXME: Record UMA Plugin_Hide_Click.
- this.hide();
- }.bind(this));
-
- contentElement.appendChild(messageElement);
- contentElement.appendChild(closeButton);
- this.appendChild(styleElement);
- this.appendChild(contentElement);
-
- this.messageElement = messageElement;
- this.closeButton = closeButton;
- };
-
PluginPlaceholderElementPrototype.hide = function() {
var host = (this.parentNode instanceof ShadowRoot) ? this.parentNode.host : this;
host.style.display = 'none';
@@ -90,14 +42,4 @@ installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot
}
}
};
-
- Object.defineProperty(PluginPlaceholderElementPrototype, 'message', {
- get: function() { return this.messageElement.textContent; },
- set: function(message) { this.messageElement.textContent = message; },
- });
-
- Object.defineProperty(PluginPlaceholderElementPrototype, 'closeable', {
- get: function() { return this.closeButton.style.display != 'none'; },
- set: function(closeable) { this.closeButton.style.display = closeable ? '' : 'none'; },
- });
});
« no previous file with comments | « Source/core/html/shadow/PluginPlaceholderElement.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698