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

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

Issue 1842403003: Added Version Info page to toolbar menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@toolbar_menu
Patch Set: Addressed review comments Created 4 years, 8 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 6213cb63c12cdd1e441b803686705b73e7c9e173..e1c584c777ac0714026c8d3efb649fbffd3dee27 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
@@ -16,6 +16,7 @@ import org.chromium.blimp.auth.TokenSource;
import org.chromium.blimp.auth.TokenSourceImpl;
import org.chromium.blimp.input.WebInputBox;
import org.chromium.blimp.session.BlimpClientSession;
+import org.chromium.blimp.session.EngineInfo;
import org.chromium.blimp.session.TabControlFeature;
import org.chromium.blimp.toolbar.Toolbar;
import org.chromium.ui.widget.Toast;
@@ -24,8 +25,9 @@ import org.chromium.ui.widget.Toast;
* The {@link Activity} for rendering the main Blimp client. This loads the Blimp rendering stack
* and displays it.
*/
-public class BlimpRendererActivity extends Activity
- implements BlimpLibraryLoader.Callback, TokenSource.Callback, BlimpClientSession.Callback {
+public class BlimpRendererActivity
+ extends Activity implements BlimpLibraryLoader.Callback, TokenSource.Callback,
+ BlimpClientSession.ConnectionObserver {
private static final int ACCOUNT_CHOOSER_INTENT_REQUEST_CODE = 100;
private static final String TAG = "BlimpRendererActivity";
@@ -76,6 +78,9 @@ public class BlimpRendererActivity extends Activity
}
if (mToolbar != null) {
+ if (mBlimpClientSession != null) {
+ mBlimpClientSession.removeObserver(mToolbar);
+ }
mToolbar.destroy();
mToolbar = null;
}
@@ -92,6 +97,7 @@ public class BlimpRendererActivity extends Activity
// Destroy the BlimpClientSession last, as all other features may rely on it.
if (mBlimpClientSession != null) {
+ mBlimpClientSession.removeObserver(this);
mBlimpClientSession.destroy();
mBlimpClientSession = null;
}
@@ -133,13 +139,15 @@ public class BlimpRendererActivity extends Activity
setContentView(R.layout.blimp_main);
- mBlimpClientSession = new BlimpClientSession(this);
+ mBlimpClientSession = new BlimpClientSession();
+ mBlimpClientSession.addObserver(this);
mBlimpView = (BlimpView) findViewById(R.id.renderer);
mBlimpView.initializeRenderer(mBlimpClientSession);
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar.initialize(mBlimpClientSession);
+ mBlimpClientSession.addObserver(mToolbar);
mWebInputBox = (WebInputBox) findViewById(R.id.editText);
mWebInputBox.initialize(mBlimpClientSession);
@@ -200,9 +208,10 @@ public class BlimpRendererActivity extends Activity
startActivityForResult(suggestedIntent, ACCOUNT_CHOOSER_INTENT_REQUEST_CODE);
}
- // BlimpClientSession.Callback implementation.
+ // BlimpClientSession.ConnectionObserver interface.
@Override
- public void onAssignmentReceived(int result, int suggestedMessageResourceId) {
+ public void onAssignmentReceived(
+ int result, int suggestedMessageResourceId, EngineInfo engineInfo) {
Toast.makeText(this, suggestedMessageResourceId, Toast.LENGTH_LONG).show();
}

Powered by Google App Engine
This is Rietveld 408576698