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

Unified Diff: chrome/common/extensions/docs/examples/apps/calculator/app/controller.js

Issue 254473011: Introduce chrome.shell.createWindow stub API for app_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix deps (shell-api) Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | chrome/renderer/chrome_content_renderer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | chrome/renderer/chrome_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698