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

Side by Side Diff: chrome/browser/resources/net_internals/tabswitcherview.js

Issue 5228004: Switch the about:gpu implementation from an about handler to dom_ui.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 * TabSwitcher is an implementation of View that handles tab switching. 6 * TabSwitcher is an implementation of View that handles tab switching.
7 * 7 *
8 * +-----------------------------------+ 8 * +-----------------------------------+
9 * | Tab1 / Tab2 / Tab3 / .. | <- tab handle view 9 * | Tab1 / Tab2 / Tab3 / .. | <- tab handle view
10 * +-----------------------------------+ 10 * +-----------------------------------+
11 * | | 11 * | |
12 * | | 12 * | |
13 * | | 13 * | |
14 * | stacked tab content areas | 14 * | stacked tab content areas |
15 * | (only 1 is visible at a time) | 15 * | (only 1 is visible at a time) |
16 * | | 16 * | |
17 * | | 17 * | |
18 * | | 18 * | |
19 * +-----------------------------------+ 19 * +-----------------------------------+
20 * 20 *
21 * @parameter {!View} tabHandleView the view that contains the tab handles. 21 * @parameter {!View} tabHandleView the view that contains the tab handles.
22 * 22 *
23 * @constructor 23 * @constructor
24 */ 24 */
25 function TabSwitcherView(tabHandleView) { 25 function TabSwitcherView(tabHandleDivId) {
26 changeClassName(document.getElementById(tabHandleDivId),
arv (Not doing code reviews) 2010/12/06 19:45:57 element.classList.add?
nduca 2010/12/07 01:03:40 Done.
27 'tab-switcher-view', true);
28 var tabHandleView = new DivView(tabHandleDivId);
29
26 View.call(this); 30 View.call(this);
27 this.tabHandleView_ = tabHandleView; 31 this.tabHandleView_ = tabHandleView;
28 this.tabs_ = []; 32 this.tabs_ = [];
33
arv (Not doing code reviews) 2010/12/06 19:45:57 remove empty line
nduca 2010/12/07 01:03:40 Done.
29 } 34 }
30 35
31 inherits(TabSwitcherView, View); 36 inherits(TabSwitcherView, View);
32 37
33 TabSwitcherView.prototype.setGeometry = function(left, top, width, height) { 38 TabSwitcherView.prototype.setGeometry = function(left, top, width, height) {
34 TabSwitcherView.superClass_.setGeometry.call(this, left, top, width, height); 39 TabSwitcherView.superClass_.setGeometry.call(this, left, top, width, height);
35 40
36 this.tabHandleView_.setGeometry( 41 this.tabHandleView_.setGeometry(
37 left, top, width, this.tabHandleView_.getHeight()); 42 left, top, width, this.tabHandleView_.getHeight());
38 43
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (oldTab) 120 if (oldTab)
116 oldTab.setSelected(false); 121 oldTab.setSelected(false);
117 122
118 var newTab = this.findTabById(id); 123 var newTab = this.findTabById(id);
119 newTab.setSelected(true); 124 newTab.setSelected(true);
120 if (params) 125 if (params)
121 newTab.contentView.setParameters(params); 126 newTab.contentView.setParameters(params);
122 127
123 // Update data needed by newly active tab, as it may be 128 // Update data needed by newly active tab, as it may be
124 // significantly out of date. 129 // significantly out of date.
125 g_browser.checkForUpdatedInfo(); 130 if(g_browser && g_browser.checkForUpdatedInfo)
arv (Not doing code reviews) 2010/12/06 19:45:57 ws
arv (Not doing code reviews) 2010/12/06 19:45:57 Didn't you rename g_browser?
nduca 2010/12/07 01:03:40 I did for gpu_internals, but gpu_internals browser
131 g_browser.checkForUpdatedInfo();
126 }; 132 };
127 133
128 TabSwitcherView.prototype.getAllTabIds = function() { 134 TabSwitcherView.prototype.getAllTabIds = function() {
129 var ids = []; 135 var ids = [];
130 for (var i = 0; i < this.tabs_.length; ++i) 136 for (var i = 0; i < this.tabs_.length; ++i)
131 ids.push(this.tabs_[i].id); 137 ids.push(this.tabs_[i].id);
132 return ids; 138 return ids;
133 }; 139 };
134 140
135 //----------------------------------------------------------------------------- 141 //-----------------------------------------------------------------------------
(...skipping 12 matching lines...) Expand all
148 this.contentView.show(isSelected); 154 this.contentView.show(isSelected);
149 }; 155 };
150 156
151 /** 157 /**
152 * Returns the DOM node that is used to select the tab. 158 * Returns the DOM node that is used to select the tab.
153 */ 159 */
154 TabEntry.prototype.getTabHandleNode = function() { 160 TabEntry.prototype.getTabHandleNode = function() {
155 return document.getElementById(this.id); 161 return document.getElementById(this.id);
156 }; 162 };
157 163
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698