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

Side by Side Diff: sky/sdk/example/demo_launcher/lib/main.dart

Issue 1227663003: Make examples which do not yet support skyx still work in skyx mode. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:sky'; 5 import 'dart:sky';
6 6
7 import 'package:sky/mojo/activity.dart' as activity; 7 import 'package:sky/mojo/activity.dart' as activity;
8 import 'package:sky/mojo/asset_bundle.dart'; 8 import 'package:sky/mojo/asset_bundle.dart';
9 import 'package:sky/mojo/shell.dart' as shell; 9 import 'package:sky/mojo/shell.dart' as shell;
10 import 'package:sky/painting/box_painter.dart'; 10 import 'package:sky/painting/box_painter.dart';
(...skipping 12 matching lines...) Expand all
23 AssetBundle _initBundle() { 23 AssetBundle _initBundle() {
24 if (rootBundle != null) 24 if (rootBundle != null)
25 return rootBundle; 25 return rootBundle;
26 const String _kAssetBase = '..'; 26 const String _kAssetBase = '..';
27 return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase)); 27 return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase));
28 } 28 }
29 29
30 final AssetBundle _bundle = _initBundle(); 30 final AssetBundle _bundle = _initBundle();
31 31
32 void launch(String relativeUrl, String bundle) { 32 void launch(String relativeUrl, String bundle) {
33 Uri url = Uri.base.resolve(relativeUrl); 33 // TODO(eseidel): This is a hack to keep non-skyx examples working for now:
34 Uri productionBase = Uri.parse(
35 'https://domokit.github.io/example/demo_launcher/lib/main.dart');
36 Uri base = rootBundle == null ? Uri.base : productionBase;
37 Uri url = base.resolve(relativeUrl);
34 38
35 activity.ComponentName component = new activity.ComponentName() 39 activity.ComponentName component = new activity.ComponentName()
36 ..packageName = 'org.domokit.sky.demo' 40 ..packageName = 'org.domokit.sky.demo'
37 ..className = 'org.domokit.sky.demo.SkyDemoActivity'; 41 ..className = 'org.domokit.sky.demo.SkyDemoActivity';
38 activity.Intent intent = new activity.Intent() 42 activity.Intent intent = new activity.Intent()
39 ..action = 'android.intent.action.VIEW' 43 ..action = 'android.intent.action.VIEW'
40 ..component = component 44 ..component = component
41 ..flags = activity.MULTIPLE_TASK | activity.NEW_DOCUMENT 45 ..flags = activity.MULTIPLE_TASK | activity.NEW_DOCUMENT
42 ..url = url.toString(); 46 ..url = url.toString();
43 47
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 ) 192 )
189 ) 193 )
190 ) 194 )
191 ); 195 );
192 } 196 }
193 } 197 }
194 198
195 void main() { 199 void main() {
196 runApp(new SkyHome()); 200 runApp(new SkyHome());
197 } 201 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698