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

Side by Side Diff: tools/dom/src/chrome/sample.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
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 part of chrome;
6
7 // This is an example of exposing chrome APIs in Dart and will be replaced with
8 // the proper implementation in the future.
9
10 class AppModule {
11 AppModule._();
12
13 WindowModule get window => new WindowModule._();
14 }
15
16 class WindowModule {
17 WindowModule._();
18
19 void create(String url) {
20 var chrome = JS('', 'chrome');
21
22 if (chrome == null) {
23 throw new UnsupportedError('Not supported by current browser');
24 }
25 var app = JS('', '#.app', chrome);
26 if (app == null) {
27 throw new UnsupportedError('Not supported by current browser');
28 }
29 var window = JS('', '#.window', app);
30 if (app == null) {
31 throw new UnsupportedError('Not supported by current browser');
32 }
33 JS('void', '#.create(#)', window, url);
34 }
35 }
36
37 final app = new AppModule._();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698