| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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: feedbackInfo.useSystemWindowFrame ? 'chrome' : 'none', | 263 frame: feedbackInfo.useSystemWindowFrame ? 'chrome' : 'none', |
| 264 id: FEEDBACK_DEFAULT_WINDOW_ID, | 264 id: FEEDBACK_DEFAULT_WINDOW_ID, |
| 265 width: FEEDBACK_WIDTH, | 265 innerBounds: { |
| 266 height: FEEDBACK_HEIGHT, | 266 minWidth: FEEDBACK_WIDTH, |
| 267 minHeight: FEEDBACK_HEIGHT, |
| 268 }, |
| 267 hidden: true, | 269 hidden: true, |
| 268 resizable: false }, | 270 resizable: false }, |
| 269 function(appWindow) { | 271 function(appWindow) { |
| 270 var request = new FeedbackRequest(feedbackInfo); | 272 var request = new FeedbackRequest(feedbackInfo); |
| 271 | 273 |
| 272 // The feedbackInfo member of the new window should refer to the one in | 274 // The feedbackInfo member of the new window should refer to the one in |
| 273 // its corresponding FeedbackRequest object to avoid copying and | 275 // its corresponding FeedbackRequest object to avoid copying and |
| 274 // duplicatations. | 276 // duplicatations. |
| 275 appWindow.contentWindow.feedbackInfo = request.feedbackInfo_; | 277 appWindow.contentWindow.feedbackInfo = request.feedbackInfo_; |
| 276 | 278 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 290 // Observe when the window is closed. | 292 // Observe when the window is closed. |
| 291 appWindow.onClosed.addListener(function() { | 293 appWindow.onClosed.addListener(function() { |
| 292 request.onWindowClosed(); | 294 request.onWindowClosed(); |
| 293 }); | 295 }); |
| 294 }); | 296 }); |
| 295 } | 297 } |
| 296 | 298 |
| 297 chrome.runtime.onMessage.addListener(feedbackReadyHandler); | 299 chrome.runtime.onMessage.addListener(feedbackReadyHandler); |
| 298 chrome.runtime.onMessageExternal.addListener(requestFeedbackHandler); | 300 chrome.runtime.onMessageExternal.addListener(requestFeedbackHandler); |
| 299 chrome.feedbackPrivate.onFeedbackRequested.addListener(startFeedbackUI); | 301 chrome.feedbackPrivate.onFeedbackRequested.addListener(startFeedbackUI); |
| OLD | NEW |