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

Side by Side Diff: netlog_viewer/top_bar_view.js

Issue 2154753002: Serving version 1 of the web app. All code has been copied from the (Closed) Base URL: https://github.com/catapult-project/catapult.git@gh-pages
Patch Set: Removed some unecessary files. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « netlog_viewer/top_bar_view.html ('k') | netlog_viewer/top_mid_bottom_view.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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.
4
5 /**
6 * The status view at the top of the page. It displays what mode net-internals
7 * is in (capturing, viewing only, viewing loaded log), and may have extra
8 * information and actions depending on the mode.
9 */
10 var TopBarView = (function() {
11 'use strict';
12
13 // We inherit from View.
14 var superClass = DivView;
15
16 /**
17 * Main entry point. Called once the page has loaded.
18 * @constructor
19 */
20 function TopBarView() {
21 assertFirstConstructorCall(TopBarView);
22
23 superClass.call(this, TopBarView.BOX_ID);
24
25 this.nameToSubView_ = {
26 loaded: new LoadedStatusView()
27 };
28
29 this.activeSubView_ = null;
30 }
31
32 TopBarView.BOX_ID = 'top-bar-view';
33
34 cr.addSingletonGetter(TopBarView);
35
36 TopBarView.prototype = {
37 // Inherit the superclass's methods.
38 __proto__: superClass.prototype,
39
40 switchToSubView: function(name) {
41 var newSubView = this.nameToSubView_[name];
42
43 if (!newSubView)
44 throw Error('Invalid subview name');
45
46 var prevSubView = this.activeSubView_;
47 this.activeSubView_ = newSubView;
48
49 if (prevSubView)
50 prevSubView.show(false);
51 newSubView.show(this.isVisible());
52
53 // Let the subview change the color scheme of the top bar.
54 $(TopBarView.BOX_ID).className = name + '-status-view';
55
56 return newSubView;
57 },
58 };
59
60 return TopBarView;
61 })();
62
OLDNEW
« no previous file with comments | « netlog_viewer/top_bar_view.html ('k') | netlog_viewer/top_mid_bottom_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698