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

Unified Diff: packages/usage/example/example.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/usage/changelog.md ('k') | packages/usage/example/ga.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/usage/example/example.dart
diff --git a/packages/usage/example/example.dart b/packages/usage/example/example.dart
index d570341621a7fe9f6241844169dc7b9235929b1c..06578c36812c9643246b1dcfbe6ad5929668c922 100644
--- a/packages/usage/example/example.dart
+++ b/packages/usage/example/example.dart
@@ -2,9 +2,7 @@
// 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.
-/**
- * A simple web app to hand-test the usage library.
- */
+/// A simple web app to hand-test the usage library.
library usage_example;
import 'dart:html';
@@ -16,9 +14,9 @@ String _lastUa;
int _count = 0;
void main() {
- querySelector('#foo').onClick.listen((_) => _handleFoo(getAnalytics()));
- querySelector('#bar').onClick.listen((_) => _handleBar(getAnalytics()));
- querySelector('#page').onClick.listen((_) => _changePage(getAnalytics()));
+ querySelector('#foo').onClick.listen((_) => _handleFoo());
+ querySelector('#bar').onClick.listen((_) => _handleBar());
+ querySelector('#page').onClick.listen((_) => _changePage());
}
String _ua() => (querySelector('#ua') as InputElement).value.trim();
@@ -33,15 +31,18 @@ Analytics getAnalytics() {
return _analytics;
}
-void _handleFoo(Analytics analytics) {
+void _handleFoo() {
+ Analytics analytics = getAnalytics();
analytics.sendEvent('main', 'foo');
}
-void _handleBar(Analytics analytics) {
+void _handleBar() {
+ Analytics analytics = getAnalytics();
analytics.sendEvent('main', 'bar');
}
-void _changePage(Analytics analytics) {
+void _changePage() {
+ Analytics analytics = getAnalytics();
window.history.pushState(null, 'new page', '${++_count}.html');
analytics.sendScreenView(window.location.pathname);
}
« no previous file with comments | « packages/usage/changelog.md ('k') | packages/usage/example/ga.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698