Index: chrome/common/extensions/docs/examples/apps/calculator/app/controller.js |
diff --git a/chrome/common/extensions/docs/examples/apps/calculator/app/controller.js b/chrome/common/extensions/docs/examples/apps/calculator/app/controller.js |
index 2340249b78fa8c782a1b763e61a964411d8853fe..1441990483373c1df4050c4036da6ac39ab879fe 100644 |
--- a/chrome/common/extensions/docs/examples/apps/calculator/app/controller.js |
+++ b/chrome/common/extensions/docs/examples/apps/calculator/app/controller.js |
@@ -10,8 +10,12 @@ |
// in non-Chrome browsers, which is useful for example to test touch support |
// with a non-Chrome touch device. |
if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) { |
+ // Compatibility for running under app_shell, which does not have app.window. |
+ var createWindow = |
+ chrome.shell ? chrome.shell.createWindow : chrome.app.window.create; |
+ |
var showCalculatorWindow = function () { |
- chrome.app.window.create('calculator.html', { |
+ createWindow('calculator.html', { |
innerBounds: { |
width: 243, minWidth: 243, maxWidth: 243, |
height: 380, minHeight: 380, maxHeight: 380 |