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

Unified Diff: samples/third_party/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/third_party/pop-pop-win/lib/html.dart ('k') | samples/third_party/pop-pop-win/lib/poppopwin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/third_party/pop-pop-win/lib/platform_target.dart
diff --git a/samples/third_party/pop-pop-win/lib/platform_target.dart b/samples/third_party/pop-pop-win/lib/platform_target.dart
deleted file mode 100644
index 4d0b6640e54f58a6c731951361a0df6f2c369c50..0000000000000000000000000000000000000000
--- a/samples/third_party/pop-pop-win/lib/platform_target.dart
+++ /dev/null
@@ -1,71 +0,0 @@
-library ppw_platform;
-
-import 'dart:async';
-
-abstract class PlatformTarget {
- bool _initialized = false;
-
- factory PlatformTarget() => new _DefaultPlatform();
-
- PlatformTarget.base();
-
- bool get initialized => _initialized;
-
- void initialize() {
- assert(!_initialized);
- _initialized = true;
- }
-
- Future clearValues();
-
- Future setValue(String key, String value);
-
- Future<String> getValue(String key);
-
- void trackAnalyticsEvent(String category, String action, [String label,
- int value]) {
- print('Analytics:: '
- 'category: $category; action: $action; label: $label; value: $value');
- }
-
- bool get renderBig;
-
- bool get showAbout;
-
- void toggleAbout([bool value]);
-
- Stream get aboutChanged;
-}
-
-class _DefaultPlatform extends PlatformTarget {
- final Map<String, String> _values = new Map<String, String>();
- final StreamController _aboutController = new StreamController(sync: true);
- bool _about = false;
-
- _DefaultPlatform() : super.base();
-
- @override
- Future clearValues() => new Future(_values.clear);
-
- @override
- Future setValue(String key, String value) =>
- new Future(() { _values[key] = value; });
-
- @override
- Future<String> getValue(String key) => new Future(() => _values[key]);
-
- bool get renderBig => false;
-
- void toggleAbout([bool value]) {
- assert(_about != null);
- if(value == null) {
- value = !_about;
- }
- _about = value;
- _aboutController.add(null);
- }
-
- bool get showAbout => _about;
-
- Stream get aboutChanged => _aboutController.stream;
-}
« no previous file with comments | « samples/third_party/pop-pop-win/lib/html.dart ('k') | samples/third_party/pop-pop-win/lib/poppopwin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698