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

Side by Side Diff: samples-dev/swarm/UIState.dart

Issue 1766533002: Untested hacks to swarm to avoid warnings. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: MouseEvent 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 unified diff | Download patch
« no previous file with comments | « no previous file | samples-dev/swarm/swarm_ui_lib/touch/FxUtil.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 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of swarmlib; 5 part of swarmlib;
6 6
7 /** 7 /**
8 * The base class for UI state that intends to support browser history. 8 * The base class for UI state that intends to support browser history.
9 */ 9 */
10 abstract class UIState { 10 abstract class UIState {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void pushToHistory() { 53 void pushToHistory() {
54 if (_historyTracking == null) { 54 if (_historyTracking == null) {
55 throw 'history tracking not started'; 55 throw 'history tracking not started';
56 } 56 }
57 57
58 String state = JSON.encode(toHistory()); 58 String state = JSON.encode(toHistory());
59 59
60 // TODO(jmesserly): [state] should be an Object, and we should pass it to 60 // TODO(jmesserly): [state] should be an Object, and we should pass it to
61 // the state parameter instead of as a #hash URL. Right now we're working 61 // the state parameter instead of as a #hash URL. Right now we're working
62 // around b/4582542. 62 // around b/4582542.
63 window.history.pushState(null, '${document.title}#$state'); 63 window.history.pushState(null,
64 '${document.title}', '${document.title}#$state');
64 } 65 }
65 66
66 /** 67 /**
67 * Serialize the state to a form suitable for storing in browser history. 68 * Serialize the state to a form suitable for storing in browser history.
68 */ 69 */
69 Map<String, String> toHistory(); 70 Map<String, String> toHistory();
70 71
71 /** 72 /**
72 * Load the UI state from the given [values]. 73 * Load the UI state from the given [values].
73 */ 74 */
74 void loadFromHistory(Map<String, String> values); 75 void loadFromHistory(Map<String, String> values);
75 } 76 }
OLDNEW
« no previous file with comments | « no previous file | samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698