OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <include src="data.js"> | 5 <include src="data.js"> |
6 | 6 |
7 /** | 7 /** |
8 * @type {number} | 8 * @type {number} |
9 * @const | 9 * @const |
10 */ | 10 */ |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 * Callback which starts up the feedback UI. | 253 * Callback which starts up the feedback UI. |
254 * @param {Object} feedbackInfo Object containing any initial feedback info. | 254 * @param {Object} feedbackInfo Object containing any initial feedback info. |
255 */ | 255 */ |
256 function startFeedbackUI(feedbackInfo) { | 256 function startFeedbackUI(feedbackInfo) { |
257 var win = chrome.app.window.get(FEEDBACK_DEFAULT_WINDOW_ID); | 257 var win = chrome.app.window.get(FEEDBACK_DEFAULT_WINDOW_ID); |
258 if (win) { | 258 if (win) { |
259 win.show(); | 259 win.show(); |
260 return; | 260 return; |
261 } | 261 } |
262 chrome.app.window.create('html/default.html', { | 262 chrome.app.window.create('html/default.html', { |
263 frame: 'none', | 263 frame: feedbackInfo.useSystemWindowFrame ? 'chrome' : 'none', |
264 id: FEEDBACK_DEFAULT_WINDOW_ID, | 264 id: FEEDBACK_DEFAULT_WINDOW_ID, |
265 width: FEEDBACK_WIDTH, | 265 width: FEEDBACK_WIDTH, |
266 height: FEEDBACK_HEIGHT, | 266 height: FEEDBACK_HEIGHT, |
267 hidden: true, | 267 hidden: true, |
268 resizable: false }, | 268 resizable: false }, |
269 function(appWindow) { | 269 function(appWindow) { |
270 var request = new FeedbackRequest(feedbackInfo); | 270 var request = new FeedbackRequest(feedbackInfo); |
271 | 271 |
272 // The feedbackInfo member of the new window should refer to the one in | 272 // The feedbackInfo member of the new window should refer to the one in |
273 // its corresponding FeedbackRequest object to avoid copying and | 273 // its corresponding FeedbackRequest object to avoid copying and |
(...skipping 16 matching lines...) Expand all Loading... |
290 // Observe when the window is closed. | 290 // Observe when the window is closed. |
291 appWindow.onClosed.addListener(function() { | 291 appWindow.onClosed.addListener(function() { |
292 request.onWindowClosed(); | 292 request.onWindowClosed(); |
293 }); | 293 }); |
294 }); | 294 }); |
295 } | 295 } |
296 | 296 |
297 chrome.runtime.onMessage.addListener(feedbackReadyHandler); | 297 chrome.runtime.onMessage.addListener(feedbackReadyHandler); |
298 chrome.runtime.onMessageExternal.addListener(requestFeedbackHandler); | 298 chrome.runtime.onMessageExternal.addListener(requestFeedbackHandler); |
299 chrome.feedbackPrivate.onFeedbackRequested.addListener(startFeedbackUI); | 299 chrome.feedbackPrivate.onFeedbackRequested.addListener(startFeedbackUI); |
OLD | NEW |