OLD | NEW |
---|---|
(Empty) | |
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 | |
7 installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot ype) { | |
8 PluginPlaceholderElementPrototype.createCallback = function() { | |
9 // Produces DOM roughly equivalent to the following HTML: | |
10 // | |
11 // <div id="plugin-placeholder"> | |
12 // <div id="plugin-placeholder-content"> | |
13 // <div id="plugin-placeholder-message"></div> | |
14 // </div> | |
15 // </div> | |
16 // | |
17 // FIXME: Move style out of script and into CSS. | |
18 | |
19 this.id = 'plugin-placeholder'; | |
20 this.style.width = '100%'; | |
21 this.style.height = '100%'; | |
22 this.style.overflow = 'hidden'; | |
23 this.style.display = 'flex'; | |
24 this.style.alignItems = 'center'; | |
25 this.style.backgroundColor = 'gray'; | |
26 this.style.font = '12px -webkit-control'; | |
27 | |
28 var contentElement = document.createElement('div'); | |
29 contentElement.id = 'plugin-placeholder-content'; | |
30 contentElement.style.textAlign = 'center'; | |
31 contentElement.style.margin = 'auto'; | |
32 | |
33 var messageElement = document.createElement('div'); | |
34 messageElement.id = 'plugin-placeholder-message'; | |
35 | |
36 contentElement.appendChild(messageElement); | |
37 this.appendChild(contentElement); | |
38 | |
39 this.messageElement = messageElement; | |
40 }; | |
41 | |
42 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', { | |
43 get: function() { return this.messageElement.innerHTML; }, | |
esprehn
2014/09/02 23:12:00
no innerHTML should be exposed like this.
| |
44 set: function(html) { this.messageElement.innerHTML = html; }, | |
45 }); | |
46 }); | |
OLD | NEW |