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

Side by Side Diff: tools/dom/src/chrome/chrome.dart

Issue 12049030: Initial commit for Chrome.* APIs in Dart (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed getMember() and setMember(), replacing with direct calls to JS() 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 | « tools/dom/src/chrome/app.window.dart ('k') | tools/dom/src/chrome/sample.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 // 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 // chrome.app
8 class API_ChromeApp {
9 /*
10 * JS Variable
11 */
12 Object _jsObject;
13
14 /*
15 * Members
16 */
17 API_ChromeAppWindow window;
18 API_ChromeAppRuntime runtime;
19
20 /*
21 * Constructor
22 */
23 API_ChromeApp(this._jsObject) {
24 var window_object = JS('', '#.window', this._jsObject);
25 if (window_object == null)
26 throw new UnsupportedError('Not supported by current browser.');
27 window = new API_ChromeAppWindow(window_object);
28
29 var runtime_object = JS('', '#.runtime', this._jsObject);
30 if (runtime_object == null)
31 throw new UnsupportedError('Not supported by current browser.');
32 runtime = new API_ChromeAppRuntime(runtime_object);
33 }
34 }
35
36 // chrome
37 class API_Chrome {
38 /*
39 * JS Variable
40 */
41 Object _jsObject;
42
43 /*
44 * Members
45 */
46 API_ChromeApp app;
47
48 /*
49 * Constructor
50 */
51 API_Chrome() {
52 this._jsObject = JS("Object", "chrome");
53 if (this._jsObject == null)
54 throw new UnsupportedError('Not supported by current browser.');
55
56 var app_object = JS('', '#.app', this._jsObject);
57 if (app_object == null)
58 throw new UnsupportedError('Not supported by current browser.');
59 app = new API_ChromeApp(app_object);
60 }
61 }
62
63 // The final chrome objects
64 final API_Chrome chrome = new API_Chrome();
OLDNEW
« no previous file with comments | « tools/dom/src/chrome/app.window.dart ('k') | tools/dom/src/chrome/sample.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698