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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/libraries.dart ('k') | sdk/lib/chrome/dartium/chrome_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/chrome/dart2js/chrome_dart2js.dart
diff --git a/sdk/lib/chrome/dart2js/chrome_dart2js.dart b/sdk/lib/chrome/dart2js/chrome_dart2js.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9ab5df76c696946e0dabee807690710ee49f56c2
--- /dev/null
+++ b/sdk/lib/chrome/dart2js/chrome_dart2js.dart
@@ -0,0 +1,46 @@
+library chrome;
+
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// DO NOT EDIT
+// Auto-generated dart:chrome library.
+
+
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+// This is an example of exposing chrome APIs in Dart and will be replaced with
+// the proper implementation in the future.
+
+class AppModule {
+ AppModule._();
+
+ WindowModule get window => new WindowModule._();
+}
+
+class WindowModule {
+ WindowModule._();
+
+ void create(String url) {
+ var chrome = JS('', 'chrome');
+
+ if (chrome == null) {
+ throw new UnsupportedError('Not supported by current browser');
+ }
+ var app = JS('', '#.app', chrome);
+ if (app == null) {
+ throw new UnsupportedError('Not supported by current browser');
+ }
ahe 2013/01/18 12:52:15 You could move the above checks to the AppModule c
+ var window = JS('', '#.window', app);
+ if (app == null) {
+ throw new UnsupportedError('Not supported by current browser');
+ }
ahe 2013/01/18 12:52:15 You might want to check this in the constructor of
+ JS('void', '#.create(#)', window, url);
+ }
+}
+
+final app = new AppModule._();
« 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