OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
mmenke
2014/10/03 18:59:26
nit: New files shouldn't use a (c). No idea why.
baranovich
2014/10/27 20:49:24
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 /** | |
6 * This view displays information related to SDCH. | |
7 * | |
8 * Shows loaded dictionaries, blacklisted domains and SDCH errors. | |
9 */ | |
10 var SdchView = (function() { | |
11 'use strict'; | |
12 | |
13 // We inherit from DivView. | |
14 var superClass = DivView; | |
15 | |
16 /** | |
17 * @constructor | |
18 */ | |
19 function SdchView() { | |
20 assertFirstConstructorCall(SdchView); | |
21 | |
22 // Call superclass's constructor. | |
23 superClass.call(this, SdchView.MAIN_BOX_ID); | |
24 | |
25 // Register to receive changes to the SDCH info. | |
26 g_browser.addSdchInfoObserver(this, false); | |
27 } | |
28 | |
29 SdchView.TAB_ID = 'tab-handle-sdch'; | |
30 SdchView.TAB_NAME = 'SDCH'; | |
31 SdchView.TAB_HASH = '#sdch'; | |
32 | |
33 // IDs for special HTML elements in sdch_view.html | |
34 SdchView.MAIN_BOX_ID = 'sdch-view-tab-content'; | |
35 | |
36 cr.addSingletonGetter(SdchView); | |
37 | |
38 SdchView.prototype = { | |
39 // Inherit the superclass's methods. | |
40 __proto__: superClass.prototype, | |
41 | |
42 onLoadLogFinish: function(data) { | |
43 return this.onSdchInfoChanged(data.sdchInfo); | |
44 }, | |
45 | |
46 onSdchInfoChanged: function(sdchInfo) { | |
47 if (!sdchInfo) | |
48 return false; | |
49 var input = new JsEvalContext(sdchInfo); | |
50 jstProcess(input, $(SdchView.MAIN_BOX_ID)); | |
51 return true; | |
52 }, | |
53 }; | |
54 | |
55 return SdchView; | |
56 })(); | |
OLD | NEW |