OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Dictionary of constants (Initialized soon after loading by data from browser, | 6 * Dictionary of constants (Initialized soon after loading by data from browser, |
7 * updated on load log). The *Types dictionaries map strings to numeric IDs, | 7 * updated on load log). The *Types dictionaries map strings to numeric IDs, |
8 * while the *TypeNames are the other way around. | 8 * while the *TypeNames are the other way around. |
9 */ | 9 */ |
10 var EventType = null; | 10 var EventType = null; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 g_browser.addConstantsObserver(new ConstantsObserver()); | 65 g_browser.addConstantsObserver(new ConstantsObserver()); |
66 | 66 |
67 // Create the tab switcher. | 67 // Create the tab switcher. |
68 this.initTabs_(); | 68 this.initTabs_(); |
69 | 69 |
70 // Cut out a small vertical strip at the top of the window, to display | 70 // Cut out a small vertical strip at the top of the window, to display |
71 // a high level status (i.e. if we are capturing events, or displaying a | 71 // a high level status (i.e. if we are capturing events, or displaying a |
72 // log file). Below it we will position the main tabs and their content | 72 // log file). Below it we will position the main tabs and their content |
73 // area. | 73 // area. |
74 this.topBarView_ = TopBarView.getInstance(this); | 74 this.topBarView_ = TopBarView.getInstance(this); |
75 var verticalSplitView = new VerticalSplitView( | 75 var verticalSplitView = |
76 this.topBarView_, this.tabSwitcher_); | 76 new VerticalSplitView(this.topBarView_, this.tabSwitcher_); |
77 | 77 |
78 superClass.call(this, verticalSplitView); | 78 superClass.call(this, verticalSplitView); |
79 | 79 |
80 // Trigger initial layout. | 80 // Trigger initial layout. |
81 this.resetGeometry(); | 81 this.resetGeometry(); |
82 | 82 |
83 window.onhashchange = this.onUrlHashChange_.bind(this); | 83 window.onhashchange = this.onUrlHashChange_.bind(this); |
84 | 84 |
85 // Select the initial view based on the current URL. | 85 // Select the initial view based on the current URL. |
86 window.onhashchange(); | 86 window.onhashchange(); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 timeutil.setTimeTickOffset(Constants.timeTickOffset); | 318 timeutil.setTimeTickOffset(Constants.timeTickOffset); |
319 }; | 319 }; |
320 | 320 |
321 /** | 321 /** |
322 * Returns true if it's given a valid-looking constants object. | 322 * Returns true if it's given a valid-looking constants object. |
323 * @param {Object} receivedConstants The received map of constants. | 323 * @param {Object} receivedConstants The received map of constants. |
324 * @return {boolean} True if the |receivedConstants| object appears valid. | 324 * @return {boolean} True if the |receivedConstants| object appears valid. |
325 */ | 325 */ |
326 function areValidConstants(receivedConstants) { | 326 function areValidConstants(receivedConstants) { |
327 return typeof(receivedConstants) == 'object' && | 327 return typeof(receivedConstants) == 'object' && |
328 typeof(receivedConstants.logEventTypes) == 'object' && | 328 typeof(receivedConstants.logEventTypes) == 'object' && |
329 typeof(receivedConstants.clientInfo) == 'object' && | 329 typeof(receivedConstants.clientInfo) == 'object' && |
330 typeof(receivedConstants.logEventPhase) == 'object' && | 330 typeof(receivedConstants.logEventPhase) == 'object' && |
331 typeof(receivedConstants.logSourceType) == 'object' && | 331 typeof(receivedConstants.logSourceType) == 'object' && |
332 typeof(receivedConstants.loadFlag) == 'object' && | 332 typeof(receivedConstants.loadFlag) == 'object' && |
333 typeof(receivedConstants.netError) == 'object' && | 333 typeof(receivedConstants.netError) == 'object' && |
334 typeof(receivedConstants.addressFamily) == 'object' && | 334 typeof(receivedConstants.addressFamily) == 'object' && |
335 typeof(receivedConstants.timeTickOffset) == 'string' && | 335 typeof(receivedConstants.timeTickOffset) == 'string' && |
336 typeof(receivedConstants.logFormatVersion) == 'number'; | 336 typeof(receivedConstants.logFormatVersion) == 'number'; |
337 } | 337 } |
338 | 338 |
339 /** | 339 /** |
340 * Returns the name for netError. | 340 * Returns the name for netError. |
341 * | 341 * |
342 * Example: netErrorToString(-105) should return | 342 * Example: netErrorToString(-105) should return |
343 * "ERR_NAME_NOT_RESOLVED". | 343 * "ERR_NAME_NOT_RESOLVED". |
344 * @param {number} netError The net error code. | 344 * @param {number} netError The net error code. |
345 * @return {string} The name of the given error. | 345 * @return {string} The name of the given error. |
346 */ | 346 */ |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 * Returns the name for sdchProblemCode. | 388 * Returns the name for sdchProblemCode. |
389 * | 389 * |
390 * Example: sdchProblemCodeToString(5) should return | 390 * Example: sdchProblemCodeToString(5) should return |
391 * "DECODE_BODY_ERROR". | 391 * "DECODE_BODY_ERROR". |
392 * @param {number} sdchProblemCode The SDCH problem code. | 392 * @param {number} sdchProblemCode The SDCH problem code. |
393 * @return {string} The name of the given problem code. | 393 * @return {string} The name of the given problem code. |
394 */ | 394 */ |
395 function sdchProblemCodeToString(sdchProblemCode) { | 395 function sdchProblemCodeToString(sdchProblemCode) { |
396 return getKeyWithValue(SdchProblemCode, sdchProblemCode); | 396 return getKeyWithValue(SdchProblemCode, sdchProblemCode); |
397 } | 397 } |
OLD | NEW |