cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / net_internals / top_bar_view.js
blob6eb503a21af7117eb67229a7748a74f102470357
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.
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';
13 // We inherit from View.
14 var superClass = DivView;
16 /**
17 * Main entry point. Called once the page has loaded.
18 * @constructor
20 function TopBarView() {
21 assertFirstConstructorCall(TopBarView);
23 superClass.call(this, TopBarView.BOX_ID);
25 this.nameToSubView_ = {
26 capture: new CaptureStatusView(),
27 loaded: new LoadedStatusView(),
28 halted: new HaltedStatusView()
31 this.activeSubView_ = null;
34 TopBarView.BOX_ID = 'top-bar-view';
35 TopBarView.TAB_DROPDOWN_MENU_ID = 'top-bar-view-tab-selecter';
37 cr.addSingletonGetter(TopBarView);
39 TopBarView.prototype = {
40 // Inherit the superclass's methods.
41 __proto__: superClass.prototype,
43 switchToSubView: function(name) {
44 var newSubView = this.nameToSubView_[name];
46 if (!newSubView)
47 throw Error('Invalid subview name');
49 var prevSubView = this.activeSubView_;
50 this.activeSubView_ = newSubView;
52 if (prevSubView)
53 prevSubView.show(false);
54 newSubView.show(this.isVisible());
56 // Let the subview change the color scheme of the top bar.
57 $(TopBarView.BOX_ID).className = name + '-status-view';
59 return newSubView;
63 return TopBarView;
64 })();