Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: chrome/browser/resources/net_internals/sdch_view.js

Issue 423813002: Sdch view for net-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Lots. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/net_internals/sdch_view.js
diff --git a/chrome/browser/resources/net_internals/sdch_view.js b/chrome/browser/resources/net_internals/sdch_view.js
new file mode 100644
index 0000000000000000000000000000000000000000..f32a80aa69b1fc0d53f165e56e4b2ed1be28e6b1
--- /dev/null
+++ b/chrome/browser/resources/net_internals/sdch_view.js
@@ -0,0 +1,56 @@
+// 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.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * This view displays information related to SDCH.
+ *
+ * Shows loaded dictionaries, blacklisted domains and SDCH errors.
+ */
+var SdchView = (function() {
+ 'use strict';
+
+ // We inherit from DivView.
+ var superClass = DivView;
+
+ /**
+ * @constructor
+ */
+ function SdchView() {
+ assertFirstConstructorCall(SdchView);
+
+ // Call superclass's constructor.
+ superClass.call(this, SdchView.MAIN_BOX_ID);
+
+ // Register to receive changes to the SDCH info.
+ g_browser.addSdchInfoObserver(this, false);
+ }
+
+ SdchView.TAB_ID = 'tab-handle-sdch';
+ SdchView.TAB_NAME = 'SDCH';
+ SdchView.TAB_HASH = '#sdch';
+
+ // IDs for special HTML elements in sdch_view.html
+ SdchView.MAIN_BOX_ID = 'sdch-view-tab-content';
+
+ cr.addSingletonGetter(SdchView);
+
+ SdchView.prototype = {
+ // Inherit the superclass's methods.
+ __proto__: superClass.prototype,
+
+ onLoadLogFinish: function(data) {
+ return this.onSdchInfoChanged(data.sdchInfo);
+ },
+
+ onSdchInfoChanged: function(sdchInfo) {
+ if (!sdchInfo)
+ return false;
+ var input = new JsEvalContext(sdchInfo);
+ jstProcess(input, $(SdchView.MAIN_BOX_ID));
+ return true;
+ },
+ };
+
+ return SdchView;
+})();

Powered by Google App Engine
This is Rietveld 408576698