OLD | NEW |
1 /** | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 * This is a placeholder to create the | 2 // Use of this source code is governed by a BSD-style license that can be |
3 * IDR_PRIVATE_SCRIPT_PLUGINPLACEHOLDERELEMENT_JS resource. | 3 // found in the LICENSE file. |
4 * | 4 |
5 * It will be replaced by a complete file in: | 5 'use strict'; |
6 * https://codereview.chromium.org/522783002/ | 6 |
7 */ | 7 installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot
ype) { |
| 8 PluginPlaceholderElementPrototype.createdCallback = function() { |
| 9 // FIXME: Move style out of script and into CSS. |
| 10 |
| 11 this.id = 'plugin-placeholder'; |
| 12 this.style.width = '100%'; |
| 13 this.style.height = '100%'; |
| 14 this.style.overflow = 'hidden'; |
| 15 this.style.display = 'flex'; |
| 16 this.style.alignItems = 'center'; |
| 17 this.style.backgroundColor = 'gray'; |
| 18 this.style.font = '12px -webkit-control'; |
| 19 |
| 20 var contentElement = document.createElement('div'); |
| 21 contentElement.id = 'plugin-placeholder-content'; |
| 22 contentElement.style.textAlign = 'center'; |
| 23 contentElement.style.margin = 'auto'; |
| 24 |
| 25 var messageElement = document.createElement('div'); |
| 26 messageElement.id = 'plugin-placeholder-message'; |
| 27 |
| 28 contentElement.appendChild(messageElement); |
| 29 this.appendChild(contentElement); |
| 30 |
| 31 this.messageElement = messageElement; |
| 32 }; |
| 33 |
| 34 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', { |
| 35 get: function() { return this.messageElement.textContent; }, |
| 36 set: function(message) { this.messageElement.textContent = message; }, |
| 37 }); |
| 38 }); |
OLD | NEW |