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

Side by Side Diff: samples/swarm/App.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/spirodraw/ColorPicker.dart ('k') | samples/swarm/BiIterator.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * The base class that should be extended by all HTML applications. 6 * The base class that should be extended by all HTML applications.
7 * 7 *
8 * It should both be easy to use for users coming over from JavaScript, but 8 * It should both be easy to use for users coming over from JavaScript, but
9 * also offer a clear notion of OO encapsulation. 9 * also offer a clear notion of OO encapsulation.
10 * 10 *
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 print('App cache update ready, now swapping...'); 82 print('App cache update ready, now swapping...');
83 window.applicationCache.swapCache(); 83 window.applicationCache.swapCache();
84 print('App cache swapped, now reloading page...'); 84 print('App cache swapped, now reloading page...');
85 window.location.reload(); 85 window.location.reload();
86 return true; 86 return true;
87 } 87 }
88 88
89 /** Returns true if we are running as a packaged application. */ 89 /** Returns true if we are running as a packaged application. */
90 static bool get isPackaged() { 90 static bool get isPackaged {
91 return window.location.protocol == 'chrome-extension:'; 91 return window.location.protocol == 'chrome-extension:';
92 } 92 }
93 93
94 /** 94 /**
95 * Gets the server URL. This is needed when we are loaded from a packaged 95 * Gets the server URL. This is needed when we are loaded from a packaged
96 * Chrome app. 96 * Chrome app.
97 */ 97 */
98 static String serverUrl(String url) { 98 static String serverUrl(String url) {
99 if (isPackaged) { 99 if (isPackaged) {
100 // TODO(jmesserly): Several problems with this: 100 // TODO(jmesserly): Several problems with this:
101 // * How do we authenticate against the server? 101 // * How do we authenticate against the server?
102 // * How do we talk to a server other than thump? 102 // * How do we talk to a server other than thump?
103 assert(url.startsWith('/')); 103 assert(url.startsWith('/'));
104 return 'http://thump.googleplex.com$url'; 104 return 'http://thump.googleplex.com$url';
105 } else { 105 } else {
106 return url; 106 return url;
107 } 107 }
108 } 108 }
109 } 109 }
OLDNEW
« no previous file with comments | « samples/spirodraw/ColorPicker.dart ('k') | samples/swarm/BiIterator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698