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

Side by Side Diff: samples/github/lib/src/commit_list_presenter.dart

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 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 | « samples/github/lib/github.immi ('k') | samples/github/lib/src/commit_presenter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino 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
5 import 'github_services.dart';
6 import 'commit_presenter.dart';
7
8 import 'package:immi/dart/immi.dart';
9 import 'package:immi_samples/sliding_window.dart';
10
11 class CommitListPresenter {
12 Repository _repository;
13 SlidingWindow _presenter;
14
15 CommitListPresenter(this._repository) {
16 var commitPresenter = new CommitPresenter(_repository);
17 _presenter = new SlidingWindow(commitPresenter);
18 }
19
20 // TODO(zerny): We should represent methods on nodes in a class structure and
21 // support identity-preserving composition.
22 Function _displayCache = null;
23 Function _wrappedDisplayCache = null;
24 Function _wrapDisplayForPrefetching(Function display) {
25 if (display != _displayCache) {
26 _displayCache = display;
27 _wrappedDisplayCache = (int start, int end) {
28 _repository.prefetchCommitsInRange(start, end);
29 (display)(start, end);
30 };
31 }
32 return _wrappedDisplayCache;
33 }
34
35 SlidingWindowNode present(Node previous) {
36 SlidingWindowNode window = _presenter.present();
37 return new SlidingWindowNode(
38 window: window.window,
39 startOffset: window.startOffset,
40 windowOffset: window.windowOffset,
41 minimumCount: window.minimumCount,
42 maximumCount: window.maximumCount,
43 toggle: window.toggle,
44 display: _wrapDisplayForPrefetching(window.display));
45 }
46 }
OLDNEW
« no previous file with comments | « samples/github/lib/github.immi ('k') | samples/github/lib/src/commit_presenter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698