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

Unified Diff: blimp/client/app/android/java/src/org/chromium/blimp/session/TabControlFeature.java

Issue 2493333002: Move Java Blimp shell code to app subpackage (Closed)
Patch Set: Merge branch 'refs/heads/master' into blimp-shell-integration Created 4 years, 1 month 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
Index: blimp/client/app/android/java/src/org/chromium/blimp/session/TabControlFeature.java
diff --git a/blimp/client/app/android/java/src/org/chromium/blimp/session/TabControlFeature.java b/blimp/client/app/android/java/src/org/chromium/blimp/session/TabControlFeature.java
deleted file mode 100644
index 4cbbde6bb22928580c192b3348939dbae0d27b98..0000000000000000000000000000000000000000
--- a/blimp/client/app/android/java/src/org/chromium/blimp/session/TabControlFeature.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.blimp.session;
-
-import android.view.View;
-
-import org.chromium.base.annotations.JNINamespace;
-
-/**
- * A Java representation of the native ControlFeature class. Provides easy access for Java control
- * UI to interact with the native content-lite feature proxy and talk to the engine.
- */
-@JNINamespace("blimp::client")
-public class TabControlFeature implements View.OnLayoutChangeListener {
- private View mContentAreaView;
- private long mNativeTabControlFeatureAndroidPtr;
-
- /**
- * Creates an instance of a {@link TabControlFeature}. This will register with
- * {@code contentAreaView} as a {@link android.view.View.OnLayoutChangeListener} and will
- * unregister when {@link #destroy()} is called.
- * @param blimpClientSession The {@link BlimpClientSession} that contains the content-lite
- * features required by the native components of the
- * {@link TabControlFeature}.
- * @param contentAreaView A {@link View} that represents the content area of the screen.
- * This is used to notify the engine of the correct size of the web
- * content area.
- */
- public TabControlFeature(BlimpClientSession blimpClientSession, View contentAreaView) {
- mContentAreaView = contentAreaView;
- mContentAreaView.addOnLayoutChangeListener(this);
- mNativeTabControlFeatureAndroidPtr = nativeInit(blimpClientSession);
- }
-
- /**
- * Tears down the native counterpart to this class and unregisters any {@link View} listeners.
- * This class should not be used after this.
- */
- public void destroy() {
- if (mContentAreaView != null) {
- mContentAreaView.removeOnLayoutChangeListener(this);
- mContentAreaView = null;
- }
-
- if (mNativeTabControlFeatureAndroidPtr != 0) {
- nativeDestroy(mNativeTabControlFeatureAndroidPtr);
- mNativeTabControlFeatureAndroidPtr = 0;
- }
- }
-
- // View.OnLayoutChangeListener implementation.
- @Override
- public void onLayoutChange(View v, int left, int top, int right, int bottom,
- int oldLeft, int oldTop, int oldRight, int oldBottom) {
- if (mNativeTabControlFeatureAndroidPtr == 0) return;
- nativeOnContentAreaSizeChanged(mNativeTabControlFeatureAndroidPtr, right - left,
- bottom - top,
- mContentAreaView.getContext().getResources().getDisplayMetrics().density);
- }
-
- private native long nativeInit(BlimpClientSession blimpClientSession);
- private native void nativeDestroy(long nativeTabControlFeatureAndroid);
- private native void nativeOnContentAreaSizeChanged(
- long nativeTabControlFeatureAndroid, int width, int height, float dpToPx);
-}

Powered by Google App Engine
This is Rietveld 408576698