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

Unified Diff: site/try/src/user_option.dart

Issue 2232273004: Delete site/try (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
« dart.gyp ('K') | « site/try/src/ui.dart ('k') | site/try/ssl.appcache » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site/try/src/user_option.dart
diff --git a/site/try/src/user_option.dart b/site/try/src/user_option.dart
deleted file mode 100644
index 532c3f770d1ed7080707c5d0bccd1d0e07b0fd59..0000000000000000000000000000000000000000
--- a/site/try/src/user_option.dart
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library trydart.userOption;
-
-/// Persistent user-configurable option.
-///
-/// Options included in [options] in settings.dart will automatically be
-/// included in the settings UI unless [isHidden] is true.
-///
-/// The value of an option is persisted in [storage] which is normally the
-/// browser's "localStorage", and [name] is a key in "localStorage". This
-/// means that hidden options can be controlled by opening the JavaScript
-/// console and evaluate:
-///
-/// localStorage['name'] = value // or
-/// localStorage.name = value
-///
-/// An option can be reset to the default value using:
-///
-/// delete localStorage['name'] // or
-/// delete localStorage.name
-class UserOption {
- final String name;
-
- final bool isHidden;
-
- static var storage;
-
- const UserOption(this.name, {this.isHidden: false});
-
- get value => storage[name];
-
- void set value(newValue) {
- storage[name] = newValue;
- }
-
- void setIfNotInitialized(newValueEvaluator()) {
- if (storage[name] == null) {
- value = newValueEvaluator();
- }
- }
-}
-
-class BooleanUserOption extends UserOption {
- const BooleanUserOption(String name, {bool isHidden: false})
- : super(name, isHidden: isHidden);
-
- bool get value => super.value == 'true';
-
- void set value(bool newValue) {
- super.value = '$newValue';
- }
-}
-
-class StringUserOption extends UserOption {
- const StringUserOption(String name, {bool isHidden: false})
- : super(name, isHidden: isHidden);
-
- String get value => super.value == null ? '' : super.value;
-
- void set value(String newValue) {
- super.value = newValue;
- }
-}
« dart.gyp ('K') | « site/try/src/ui.dart ('k') | site/try/ssl.appcache » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698