1 // Copyright (c) 2012 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.
6 * This view displays information related to Prerendering.
8 var PrerenderView
= (function() {
11 // We inherit from DivView.
12 var superClass
= DivView
;
17 function PrerenderView() {
18 assertFirstConstructorCall(PrerenderView
);
20 // Call superclass's constructor.
21 superClass
.call(this, PrerenderView
.MAIN_BOX_ID
);
23 g_browser
.addPrerenderInfoObserver(this, true);
26 PrerenderView
.TAB_ID
= 'tab-handle-prerender';
27 PrerenderView
.TAB_NAME
= 'Prerender';
28 PrerenderView
.TAB_HASH
= '#prerender';
30 // IDs for special HTML elements in prerender_view.html
31 PrerenderView
.MAIN_BOX_ID
= 'prerender-view-tab-content';
34 PrerenderView
.HISTORY_TABLE_ID
= 'prerender-view-history-table';
35 PrerenderView
.ACTIVE_TABLE_ID
= 'prerender-view-active-table';
37 cr
.addSingletonGetter(PrerenderView
);
39 PrerenderView
.prototype = {
40 // Inherit the superclass's methods.
41 __proto__
: superClass
.prototype,
43 onLoadLogFinish: function(data
) {
44 return this.onPrerenderInfoChanged(data
.prerenderInfo
);
47 onPrerenderInfoChanged: function(prerenderInfo
) {
50 var input
= new JsEvalContext(prerenderInfo
);
51 jstProcess(input
, $(PrerenderView
.MAIN_BOX_ID
));