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

Side by Side Diff: chrome/browser/resources/sessions.js

Issue 8590031: Added machine names to about:sessions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed quotation marks. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sessions_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 localStrings = new LocalStrings(); 5 localStrings = new LocalStrings();
6 6
7 // UTF8 sequence for an arrow triangle pointing down. 7 // UTF8 sequence for an arrow triangle pointing down.
8 kExpandedArrow = "\u25BE"; 8 kExpandedArrow = "\u25BE";
9 // UTF8 sequence for an arrow triangle pointing right. 9 // UTF8 sequence for an arrow triangle pointing right.
10 kCollapsedArrow = "\u25B8"; 10 kCollapsedArrow = "\u25B8";
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 windowDiv.appendChild(createTitleDiv('window-title', 'Window')); 75 windowDiv.appendChild(createTitleDiv('window-title', 'Window'));
76 addItems(windowDiv, window.tabs, transformTab); 76 addItems(windowDiv, window.tabs, transformTab);
77 return windowDiv; 77 return windowDiv;
78 } 78 }
79 79
80 /** 80 /**
81 * Transforms a session into an HTML element. 81 * Transforms a session into an HTML element.
82 */ 82 */
83 function transformSession(session) { 83 function transformSession(session) {
84 var sessionDiv = document.createElement('div'); 84 var sessionDiv = document.createElement('div');
85 var sessionName = session.name.length == 0 ? 'Session' : session.name;
85 sessionDiv.className = "session"; 86 sessionDiv.className = "session";
86 sessionDiv.appendChild(createTitleDiv('session-title', 'Session')); 87 sessionDiv.appendChild(createTitleDiv('session-title', sessionName));
87 addItems(sessionDiv, session.windows, transformWindow); 88 addItems(sessionDiv, session.windows, transformWindow);
88 return sessionDiv; 89 return sessionDiv;
89 } 90 }
90 91
91 /** 92 /**
92 * Creates the UI for the sessions tree. 93 * Creates the UI for the sessions tree.
93 */ 94 */
94 function createSessionTreeUI(sessionList) { 95 function createSessionTreeUI(sessionList) {
95 $('sessions-summary-text').textContent = 96 $('sessions-summary-text').textContent =
96 localStrings.getStringF('sessionsCountFormat', sessionList.length); 97 localStrings.getStringF('sessionsCountFormat', sessionList.length);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 * Callback from backend with the list of sessions. Builds the UI. 131 * Callback from backend with the list of sessions. Builds the UI.
131 * @param {array} sessionList The list of sessions. 132 * @param {array} sessionList The list of sessions.
132 * @param {array} magicList List of "interesting" tabs. 133 * @param {array} magicList List of "interesting" tabs.
133 */ 134 */
134 function updateSessionList(sessionList, magicList) { 135 function updateSessionList(sessionList, magicList) {
135 createSessionTreeUI(sessionList); 136 createSessionTreeUI(sessionList);
136 createMagicListUI(magicList); 137 createMagicListUI(magicList);
137 } 138 }
138 139
139 document.addEventListener('DOMContentLoaded', requestSessions); 140 document.addEventListener('DOMContentLoaded', requestSessions);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sessions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698