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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 function pluginGotCopy_(event) { | 137 function pluginGotCopy_(event) { |
138 if (event && event.clipboardData) { | 138 if (event && event.clipboardData) { |
139 if (remoting.clipboard.toOs(event.clipboardData)) { | 139 if (remoting.clipboard.toOs(event.clipboardData)) { |
140 // The default action may overwrite items that we added to clipboardData. | 140 // The default action may overwrite items that we added to clipboardData. |
141 event.preventDefault(); | 141 event.preventDefault(); |
142 } | 142 } |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 /** | 146 /** |
147 * @return {Object.<string, string>} The URL parameters. | |
148 */ | |
149 function getUrlParameters_() { | |
150 var result = {}; | |
151 var parts = window.location.search.substring(1).split('&'); | |
152 for (var i = 0; i < parts.length; i++) { | |
153 var pair = parts[i].split('='); | |
154 result[pair[0]] = decodeURIComponent(pair[1]); | |
155 } | |
156 return result; | |
157 } | |
158 | |
159 /** | |
160 * Return the current time as a formatted string suitable for logging. | 147 * Return the current time as a formatted string suitable for logging. |
161 * | 148 * |
162 * @return {string} The current time, formatted as [mmdd/hhmmss.xyz] | 149 * @return {string} The current time, formatted as [mmdd/hhmmss.xyz] |
163 */ | 150 */ |
164 remoting.timestamp = function() { | 151 remoting.timestamp = function() { |
165 /** | 152 /** |
166 * @param {number} num A number. | 153 * @param {number} num A number. |
167 * @param {number} len The required length of the answer. | 154 * @param {number} len The required length of the answer. |
168 * @return {string} The number, formatted as a string of the specified length | 155 * @return {string} The number, formatted as a string of the specified length |
169 * by prepending zeroes as necessary. | 156 * by prepending zeroes as necessary. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 chrome.windows.get(tab.windowId, null, windowCallback); | 208 chrome.windows.get(tab.windowId, null, windowCallback); |
222 } | 209 } |
223 }; | 210 }; |
224 if (chrome.tabs) { | 211 if (chrome.tabs) { |
225 chrome.tabs.getCurrent(tabCallback); | 212 chrome.tabs.getCurrent(tabCallback); |
226 } else { | 213 } else { |
227 console.error('chome.tabs is not available.'); | 214 console.error('chome.tabs is not available.'); |
228 } | 215 } |
229 } | 216 } |
230 | 217 |
OLD | NEW |