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.ui.base; | |
6 | |
7 import org.chromium.base.annotations.CalledByNative; | |
8 import org.chromium.base.annotations.JNINamespace; | |
9 | |
10 /** | |
11 * Class used to forward view, input events down to native. | |
12 */ | |
13 @JNINamespace("ui") | |
14 public class EventHandler { | |
Ted C
2016/12/15 23:36:44
from the discussion yesterday, I think EventDispta
Jinsuk Kim
2016/12/16 02:04:17
Thanks for the discussion for better naming. Done.
| |
15 // The corresponding native ViewAndroid. This object can only be used while | |
16 // the native instance is alive. | |
17 private long mNativeView; | |
18 | |
19 @CalledByNative | |
20 private static EventHandler create(long nativeView) { | |
21 return new EventHandler(nativeView); | |
22 } | |
23 | |
24 private EventHandler(long nativeView) { | |
25 mNativeView = nativeView; | |
26 } | |
27 | |
28 public void onPhysicalBackingSizeChanged(int width, int height) { | |
Ted C
2016/12/15 23:36:44
can you add javadoc here...physical backing size i
Jinsuk Kim
2016/12/16 02:04:17
Done.
| |
29 assert mNativeView != 0; | |
30 nativeOnPhysicalBackingSizeChanged(mNativeView, width, height); | |
31 } | |
32 | |
33 @CalledByNative | |
34 private void onDestroyNativeView() { | |
35 mNativeView = 0; | |
36 } | |
37 | |
38 private static native void nativeOnPhysicalBackingSizeChanged(long viewAndro id, | |
39 int width, int height); | |
40 } | |
OLD | NEW |