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

Side by Side Diff: samples/pop_pop_win/chrome_app/platform_chrome_app.dart

Issue 786443002: Delete pop-pop-win from the repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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 library pop_pop_win.platform_chrome_app;
5
6 import 'dart:async';
7
8 import 'package:pop_pop_win/platform_target.dart';
9 import 'package:chrome/gen/storage.dart';
10
11 class PlatformChromeApp extends PlatformTarget {
12 final StreamController _aboutController = new StreamController(sync: true);
13 bool _about = false;
14
15 int get size => 7;
16
17 PlatformChromeApp(): super.base();
18
19 Future clearValues() => storage.local.clear();
20
21 Future setValue(String key, String value) => storage.local.set({key : value});
22
23 Future<String> getValue(String key) => storage.local.get(key)
24 .then((Map<String, String> values) => values[key]);
25
26 bool get showAbout => _about;
27
28 Stream get aboutChanged => _aboutController.stream;
29
30 void toggleAbout([bool value]) {
31 assert(_about != null);
32 if (value == null) {
33 value = !_about;
34 }
35 _about = value;
36 _aboutController.add(null);
37 }
38 }
OLDNEW
« no previous file with comments | « samples/pop_pop_win/chrome_app/manifest.json ('k') | samples/pop_pop_win/lib/assets/audio/audio.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698