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

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

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
diff --git a/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java b/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
index cd830b17b1aba6d5e200fea9d0bc964f633cfaa1..5435ece782095a4e91533d424d7efc278df93817 100644
--- a/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
+++ b/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
@@ -7,7 +7,9 @@ package org.chromium.blimp;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
+import android.os.Handler;
import android.text.TextUtils;
+import android.widget.TextView;
import org.chromium.base.Log;
import org.chromium.base.annotations.SuppressFBWarnings;
@@ -29,7 +31,8 @@ import org.chromium.ui.widget.Toast;
*/
public class BlimpRendererActivity
extends Activity implements BlimpLibraryLoader.Callback, TokenSource.Callback,
- BlimpClientSession.ConnectionObserver {
+ BlimpClientSession.ConnectionObserver,
+ BlimpClientSession.NetworkActivityObserver {
private static final int ACCOUNT_CHOOSER_INTENT_REQUEST_CODE = 100;
private static final String TAG = "BlimpRendererActivity";
@@ -43,7 +46,7 @@ public class BlimpRendererActivity
private BlimpClientSession mBlimpClientSession;
private TabControlFeature mTabControlFeature;
private WebInputBox mWebInputBox;
-
+ Handler mHandler = new Handler();
private boolean mFirstUrlLoadDone = false;
@Override
@@ -148,6 +151,7 @@ public class BlimpRendererActivity
mBlimpClientSession = new BlimpClientSession(PreferencesUtil.findAssignerUrl(this));
mBlimpClientSession.addObserver(this);
+ mBlimpClientSession.setDataObserver(this);
mBlimpView = (BlimpView) findViewById(R.id.renderer);
mBlimpView.initializeRenderer(mBlimpClientSession);
@@ -165,6 +169,28 @@ public class BlimpRendererActivity
}
@Override
+ public void onPacketSent(final int bytes) {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ TextView sTv = (TextView) findViewById(R.id.bytes_sent_client);
+ sTv.setText("Sent (KB) : " + bytes / 1000);
+ }
+ });
+ }
+
+ @Override
+ public void onPacketReceived(final int bytes) {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ TextView rTv = (TextView) findViewById(R.id.bytes_received_client);
+ rTv.setText("Received (KB) : " + bytes / 1000);
+ }
+ });
+ }
+
+ @Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
handleUrlFromIntent(intent);

Powered by Google App Engine
This is Rietveld 408576698