1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5'use strict'; 6 7installClass('PluginPlaceholderElement', function(PluginPlaceholderElementPrototype) { 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}); 39