Index: Source/core/html/shadow/PluginPlaceholderElement.js |
diff --git a/Source/core/html/shadow/PluginPlaceholderElement.js b/Source/core/html/shadow/PluginPlaceholderElement.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7167b7208010462cee1e5e768ca540737cb577b8 |
--- /dev/null |
+++ b/Source/core/html/shadow/PluginPlaceholderElement.js |
@@ -0,0 +1,46 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+'use strict'; |
+ |
+installClass('PluginPlaceholderElement', function(PluginPlaceholderElementPrototype) { |
+ PluginPlaceholderElementPrototype.createCallback = function() { |
esprehn
2014/09/09 04:13:30
createdCallback, this should be like a custom elem
jbroman
2014/09/09 14:05:23
Done.
|
+ // Produces DOM roughly equivalent to the following HTML: |
+ // |
+ // <div id="plugin-placeholder"> |
+ // <div id="plugin-placeholder-content"> |
+ // <div id="plugin-placeholder-message"></div> |
+ // </div> |
+ // </div> |
esprehn
2014/09/09 04:13:30
I'd remove this comment, the test shows the struct
jbroman
2014/09/09 14:05:23
Done.
|
+ // |
+ // FIXME: Move style out of script and into CSS. |
+ |
+ this.id = 'plugin-placeholder'; |
+ this.style.width = '100%'; |
+ this.style.height = '100%'; |
+ this.style.overflow = 'hidden'; |
+ this.style.display = 'flex'; |
+ this.style.alignItems = 'center'; |
+ this.style.backgroundColor = 'gray'; |
+ this.style.font = '12px -webkit-control'; |
+ |
+ var contentElement = document.createElement('div'); |
+ contentElement.id = 'plugin-placeholder-content'; |
+ contentElement.style.textAlign = 'center'; |
+ contentElement.style.margin = 'auto'; |
+ |
+ var messageElement = document.createElement('div'); |
+ messageElement.id = 'plugin-placeholder-message'; |
+ |
+ contentElement.appendChild(messageElement); |
+ this.appendChild(contentElement); |
+ |
+ this.messageElement = messageElement; |
+ }; |
+ |
+ Object.defineProperty(PluginPlaceholderElementPrototype, 'message', { |
+ get: function() { return this.messageElement.textContent; }, |
+ set: function(message) { this.messageElement.textContent = message; }, |
+ }); |
+}); |