| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.blimp.session; | 5 package org.chromium.blimp.session; |
| 6 | 6 |
| 7 import android.view.View; | 7 import android.view.View; |
| 8 | 8 |
| 9 import org.chromium.base.annotations.JNINamespace; | 9 import org.chromium.base.annotations.JNINamespace; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * A Java representation of the native ControlFeature class. Provides easy acce
ss for Java control | 12 * A Java representation of the native ControlFeature class. Provides easy acce
ss for Java control |
| 13 * UI to interact with the native content-lite feature proxy and talk to the eng
ine. | 13 * UI to interact with the native content-lite feature proxy and talk to the eng
ine. |
| 14 */ | 14 */ |
| 15 @JNINamespace("blimp") | 15 @JNINamespace("blimp::client") |
| 16 public class TabControlFeature implements View.OnLayoutChangeListener { | 16 public class TabControlFeature implements View.OnLayoutChangeListener { |
| 17 private final float mDpToPx; | 17 private final float mDpToPx; |
| 18 | 18 |
| 19 private View mContentAreaView; | 19 private View mContentAreaView; |
| 20 private long mNativeTabControlFeatureAndroidPtr; | 20 private long mNativeTabControlFeatureAndroidPtr; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Creates an instance of a {@link TabControlFeature}. This will register w
ith | 23 * Creates an instance of a {@link TabControlFeature}. This will register w
ith |
| 24 * {@code contentAreaView} as a {@link android.view.View.OnLayoutChangeListe
ner} and will | 24 * {@code contentAreaView} as a {@link android.view.View.OnLayoutChangeListe
ner} and will |
| 25 * unregister when {@link #destroy()} is called. | 25 * unregister when {@link #destroy()} is called. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 int oldLeft, int oldTop, int oldRight, int oldBottom) { | 62 int oldLeft, int oldTop, int oldRight, int oldBottom) { |
| 63 if (mNativeTabControlFeatureAndroidPtr == 0) return; | 63 if (mNativeTabControlFeatureAndroidPtr == 0) return; |
| 64 nativeOnContentAreaSizeChanged(mNativeTabControlFeatureAndroidPtr, right
- left, | 64 nativeOnContentAreaSizeChanged(mNativeTabControlFeatureAndroidPtr, right
- left, |
| 65 bottom - top, mDpToPx); | 65 bottom - top, mDpToPx); |
| 66 } | 66 } |
| 67 | 67 |
| 68 private native long nativeInit(BlimpClientSession blimpClientSession); | 68 private native long nativeInit(BlimpClientSession blimpClientSession); |
| 69 private native void nativeDestroy(long nativeTabControlFeatureAndroid); | 69 private native void nativeDestroy(long nativeTabControlFeatureAndroid); |
| 70 private native void nativeOnContentAreaSizeChanged( | 70 private native void nativeOnContentAreaSizeChanged( |
| 71 long nativeTabControlFeatureAndroid, int width, int height, float dp
ToPx); | 71 long nativeTabControlFeatureAndroid, int width, int height, float dp
ToPx); |
| 72 } | 72 } |
| OLD | NEW |