Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chromoting; | |
| 6 | |
| 7 import org.chromium.chromoting.jni.Client; | |
| 8 | |
| 9 /** | |
| 10 * This class manages resources related to the rendering process. Its lifetime s hould be the same | |
| 11 * as the JNI client. | |
| 12 */ | |
| 13 public class RenderController { | |
|
Hzj_jie
2016/09/08 21:37:33
I cannot quite tell the functionality of this clas
Yuwei
2016/09/08 23:09:14
Removed. The original intention was to have a chan
| |
| 14 private final Client mClient; | |
| 15 private RenderStub mRenderStub; | |
| 16 private TouchInputHandler mInputHandler; | |
| 17 | |
| 18 public RenderController(Client client) { | |
| 19 Preconditions.notNull(client); | |
| 20 mClient = client; | |
| 21 } | |
| 22 | |
| 23 /** | |
| 24 * Sets the render stub. This must be called exactly once before | |
| 25 * {@link RenderController#reset(Desktop, DesktopView)} is called. | |
| 26 * @param stub The render stub. Must not be null. | |
|
joedow
2016/09/08 18:32:47
Is "Must not be null." required in the comment? I
Yuwei
2016/09/08 23:09:15
Obsolete. Class removed.
| |
| 27 */ | |
| 28 public void setRenderStub(RenderStub stub) { | |
| 29 Preconditions.isNull(mRenderStub); | |
| 30 Preconditions.notNull(stub); | |
| 31 mRenderStub = stub; | |
| 32 } | |
| 33 | |
| 34 /** | |
| 35 * Resets the RenderController with the current activity and desktop view. M ust be called after | |
| 36 * {@link RenderController#setRenderStub(RenderStub)} is called. Both argume nts must not be | |
| 37 * null. | |
|
joedow
2016/09/08 18:32:47
Remove the comments about null params and document
Yuwei
2016/09/08 23:09:15
Obsolete.
| |
| 38 */ | |
| 39 public void reset(Desktop desktop, DesktopView view) { | |
| 40 Preconditions.notNull(desktop); | |
| 41 Preconditions.notNull(view); | |
| 42 Preconditions.notNull(mRenderStub); | |
| 43 if (mInputHandler != null) { | |
| 44 mInputHandler.invalidate(); | |
|
Yuwei
2016/09/07 20:45:40
Maybe we can make TouchInputHandler's lifetime as
joedow
2016/09/08 18:32:47
I would think of lifetime/scoping with respect to
Yuwei
2016/09/08 23:09:15
Done. Added attach/detach interface to DesktopView
| |
| 45 } | |
| 46 mRenderStub.setDesktopView(view); | |
| 47 mInputHandler = new TouchInputHandler(view, desktop); | |
| 48 mInputHandler.init(desktop, mRenderStub, new InputEventSender(mClient)); | |
|
Hzj_jie
2016/09/08 21:37:33
If you really want to keep current design, you may
Yuwei
2016/09/08 23:09:15
Not keeping :P
| |
| 49 } | |
| 50 } | |
| OLD | NEW |