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

Side by Side Diff: sdk/lib/chrome/dart2js/chrome_dart2js.dart

Issue 11958026: Stubbing out the initial library for Chrome application support. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removing native support for dart:chrome Created 7 years, 11 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 | « sdk/lib/_internal/libraries.dart ('k') | sdk/lib/chrome/dartium/chrome_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 library chrome;
2
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file.
6
7 // DO NOT EDIT
8 // Auto-generated dart:chrome library.
9
10
11 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
12 // for details. All rights reserved. Use of this source code is governed by a
13 // BSD-style license that can be found in the LICENSE file.
14
15
16 // This is an example of exposing chrome APIs in Dart and will be replaced with
17 // the proper implementation in the future.
18
19 class AppModule {
20 AppModule._();
21
22 WindowModule get window => new WindowModule._();
23 }
24
25 class WindowModule {
26 WindowModule._();
27
28 void create(String url) {
29 var chrome = JS('', 'chrome');
30
31 if (chrome == null) {
32 throw new UnsupportedError('Not supported by current browser');
33 }
34 var app = JS('', '#.app', chrome);
35 if (app == null) {
36 throw new UnsupportedError('Not supported by current browser');
37 }
ahe 2013/01/18 12:52:15 You could move the above checks to the AppModule c
38 var window = JS('', '#.window', app);
39 if (app == null) {
40 throw new UnsupportedError('Not supported by current browser');
41 }
ahe 2013/01/18 12:52:15 You might want to check this in the constructor of
42 JS('void', '#.create(#)', window, url);
43 }
44 }
45
46 final app = new AppModule._();
OLDNEW
« no previous file with comments | « sdk/lib/_internal/libraries.dart ('k') | sdk/lib/chrome/dartium/chrome_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698