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

Side by Side Diff: samples/pop_pop_win/lib/platform_target.dart

Issue 200723008: samples/poppopwin: upgrade to first-class sample (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed pkgbuild.status for rename Created 6 years, 9 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 | « samples/pop_pop_win/lib/html.dart ('k') | samples/pop_pop_win/lib/poppopwin.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library ppw_platform; 1 library ppw_platform;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 4
5 abstract class PlatformTarget { 5 abstract class PlatformTarget {
6 bool _initialized = false; 6 bool _initialized = false;
7 7
8 factory PlatformTarget() => new _DefaultPlatform(); 8 factory PlatformTarget() => new _DefaultPlatform();
9 9
10 PlatformTarget.base(); 10 PlatformTarget.base();
11 11
12 bool get initialized => _initialized; 12 bool get initialized => _initialized;
13 13
14 void initialize() { 14 void initialize() {
15 assert(!_initialized); 15 assert(!_initialized);
16 _initialized = true; 16 _initialized = true;
17 } 17 }
18 18
19 Future clearValues(); 19 Future clearValues();
20 20
21 Future setValue(String key, String value); 21 Future setValue(String key, String value);
22 22
23 Future<String> getValue(String key); 23 Future<String> getValue(String key);
24 24
25 void trackAnalyticsEvent(String category, String action, [String label,
26 int value]) {
27 print('Analytics:: '
28 'category: $category; action: $action; label: $label; value: $value');
29 }
30
31 bool get renderBig; 25 bool get renderBig;
32 26
33 bool get showAbout; 27 bool get showAbout;
34 28
35 void toggleAbout([bool value]); 29 void toggleAbout([bool value]);
36 30
37 Stream get aboutChanged; 31 Stream get aboutChanged;
38 } 32 }
39 33
40 class _DefaultPlatform extends PlatformTarget { 34 class _DefaultPlatform extends PlatformTarget {
(...skipping 21 matching lines...) Expand all
62 value = !_about; 56 value = !_about;
63 } 57 }
64 _about = value; 58 _about = value;
65 _aboutController.add(null); 59 _aboutController.add(null);
66 } 60 }
67 61
68 bool get showAbout => _about; 62 bool get showAbout => _about;
69 63
70 Stream get aboutChanged => _aboutController.stream; 64 Stream get aboutChanged => _aboutController.stream;
71 } 65 }
OLDNEW
« no previous file with comments | « samples/pop_pop_win/lib/html.dart ('k') | samples/pop_pop_win/lib/poppopwin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698