Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java |
| index 571b77e0575a4e4e6d409aba338bc9bcaf7575c5..a3e8ebbbe0049054833800e0a52c8e844922b1f1 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java |
| @@ -5,6 +5,7 @@ |
| package org.chromium.chrome.browser.browseractions; |
| import android.app.PendingIntent; |
| +import android.app.ProgressDialog; |
|
Yusuf
2017/06/29 19:05:26
I can see this being used in other files as well,
ltian
2017/06/30 23:57:56
I check there seems no Chromium widget for Progres
|
| import android.content.Intent; |
| import android.graphics.Bitmap; |
| import android.net.Uri; |
| @@ -16,6 +17,7 @@ import android.view.View; |
| import org.chromium.base.Log; |
| import org.chromium.base.annotations.SuppressFBWarnings; |
| +import org.chromium.chrome.R; |
| import org.chromium.chrome.browser.IntentHandler; |
| import org.chromium.chrome.browser.UrlConstants; |
| import org.chromium.chrome.browser.contextmenu.ContextMenuParams; |
| @@ -37,6 +39,8 @@ public class BrowserActionActivity extends AsyncInitializationActivity { |
| private String mCreatorPackageName; |
| private List<BrowserActionItem> mActions = new ArrayList<>(); |
| private BrowserActionsContextMenuHelper mHelper; |
| + private boolean mIsNatvieInitialized; |
|
Yusuf
2017/06/29 19:05:26
Native
ltian
2017/06/30 23:57:56
Done.
|
| + private ProgressDialog mProgressDialog; |
| @Override |
| protected void setContentView() { |
| @@ -162,4 +166,36 @@ public class BrowserActionActivity extends AsyncInitializationActivity { |
| public String getCreatorPackageName() { |
| return mCreatorPackageName; |
| } |
| + |
| + @Override |
| + public void finishNativeInitialization() { |
| + super.finishNativeInitialization(); |
| + mIsNatvieInitialized = true; |
| + dismissProgressDialog(); |
| + mHelper.handlePendingActions(); |
| + } |
| + |
| + private void dismissProgressDialog() { |
| + if (mProgressDialog != null && mProgressDialog.isShowing()) { |
|
Yusuf
2017/06/29 19:05:26
I would say, when you find yourself adding this mu
ltian
2017/06/30 23:57:56
Put all Progress Dialog related code to helper cla
|
| + mProgressDialog.dismiss(); |
| + } |
| + mProgressDialog = null; |
| + } |
| + |
| + /** |
| + * @return Whether Chrome native libraries are loaded. |
|
Yusuf
2017/06/29 19:05:26
LibraryLoader.isLoaded does the above.
finishNati
ltian
2017/06/30 23:57:56
Done.
|
| + */ |
| + public boolean isNatvieInitialized() { |
| + return mIsNatvieInitialized; |
| + } |
| + |
| + /** |
| + * Display a progress dialog to wait for native libraries initialized. |
| + */ |
| + public void waitNativeInitialized() { |
| + mProgressDialog = new ProgressDialog(this); |
| + mProgressDialog.setMessage( |
| + getApplicationContext().getString(R.string.browser_actions_loading_native_message)); |
| + mProgressDialog.show(); |
| + } |
| } |