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

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

Issue 8474001: Add a timeline view to about:net-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update comments Created 9 years, 1 month 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/main.js
===================================================================
--- chrome/browser/resources/net_internals/main.js (revision 109671)
+++ chrome/browser/resources/net_internals/main.js (working copy)
@@ -44,14 +44,15 @@
function MainView() {
assertFirstConstructorCall(MainView);
- // Tracks if we're viewing a loaded log file, so views can behave
- // appropriately.
- this.isViewingLoadedLog_ = false;
-
// This must be initialized before the tabs, so they can register as
// observers.
g_browser = BrowserBridge.getInstance();
+ // This must be the first constants observer, so other constants observers
+ // can safely use the globals, rather than depending on walking through
+ // the constants themselves.
+ g_browser.addConstantsObserver(new ConstantsObserver());
+
// This view is a left (resizable) navigation bar.
this.categoryTabSwitcher_ = new TabSwitcherView();
var tabs = this.categoryTabSwitcher_;
@@ -82,6 +83,8 @@
false, true);
tabs.addTab(EventsView.TAB_HANDLE_ID, EventsView.getInstance(),
false, true);
+ tabs.addTab(TimelineView.TAB_HANDLE_ID, TimelineView.getInstance(),
+ false, true);
tabs.addTab(DnsView.TAB_HANDLE_ID, DnsView.getInstance(),
false, true);
tabs.addTab(SocketsView.TAB_HANDLE_ID, SocketsView.getInstance(),
@@ -127,8 +130,6 @@
// Select the initial view based on the current URL.
window.onhashchange();
- g_browser.addConstantsObserver(new ConstantsObserver());
-
// Tell the browser that we are ready to start receiving log events.
g_browser.sendReady();
}
@@ -143,6 +144,14 @@
cr.addSingletonGetter(MainView);
+ // Tracks if we're viewing a loaded log file, so views can behave
+ // appropriately. Global so safe to call during construction.
+ var isViewingLoadedLog = false;
+
+ MainView.isViewingLoadedLog = function() {
+ return isViewingLoadedLog;
+ }
eroman 2011/11/16 04:03:46 nit: add a semicolon.
mmenke 2011/11/16 18:39:35 Done.
+
MainView.prototype = {
// Inherit the superclass's methods.
__proto__: superClass.prototype,
@@ -163,9 +172,9 @@
* @param {String} fileName The name of the log file that has been loaded.
*/
onLoadLogFile: function(fileName) {
- this.isViewingLoadedLog_ = true;
+ isViewingLoadedLog = true;
- // Swap out the status bar to indicate we have loaded from a file.
+ // Swap out the status bar to indicate we have loaded from a file.
setNodeDisplay($(MainView.STATUS_VIEW_FOR_CAPTURE_ID), false);
setNodeDisplay($(MainView.STATUS_VIEW_FOR_FILE_ID), true);
@@ -177,16 +186,8 @@
g_browser.sourceTracker.setSecurityStripping(false);
g_browser.disable();
},
-
- /**
- * Returns true if we're viewing a loaded log file.
- */
- isViewingLoadedLog: function() {
- return this.isViewingLoadedLog_;
- }
};
-
/*
* Takes the current hash in form of "#tab&param1=value1&param2=value2&...".
* Puts the parameters in an object, and passes the resulting object to

Powered by Google App Engine
This is Rietveld 408576698