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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java

Issue 1915393003: [Custom Tabs] Postpone RecordAction until native libray is loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
index 4a0556df9eb3c5f7c707171a000d94cb4d7c3854..d2de7186453d49887db38f8a4f3b847036549586 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
@@ -22,9 +22,11 @@ import android.widget.LinearLayout;
import android.widget.RemoteViews;
import org.chromium.base.Log;
+import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
+import org.chromium.chrome.browser.metrics.LaunchMetrics;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.ui.interpolators.BakedBezierInterpolator;
@@ -66,7 +68,7 @@ class CustomTabBottomBarDelegate {
RemoteViews remoteViews = mDataProvider.getBottomBarRemoteViews();
if (remoteViews != null) {
- RecordUserAction.record("CustomTabsRemoteViewsShown");
+ new LaunchMetrics.ActionEvent("CustomTabsRemoteViewsShown");
mClickableIDs = mDataProvider.getClickableViewIDs();
mClickPendingIntent = mDataProvider.getRemoteViewsPendingIntent();
showRemoteViews(remoteViews);
@@ -117,8 +119,14 @@ class CustomTabBottomBarDelegate {
PendingIntent pendingIntent) {
// Update only makes sense if we are already showing a RemoteViews.
if (mDataProvider.getBottomBarRemoteViews() == null) return false;
-
- RecordUserAction.record("CustomTabsRemoteViewsUpdated");
+ final String actionName = "CustomTabsRemoteViewsUpdated";
gone 2016/04/27 00:30:09 nit: maybe pull this up to a class level private s
Ian Wen 2016/04/27 00:39:44 Done.
+ // UMA requires native library to be loaded. Since we do not know when the client might call
+ // updateVisuals(), guard the UMA with checking to avoid crashes.
+ if (LibraryLoader.isInitialized()) {
+ RecordUserAction.record(actionName);
+ } else {
+ new LaunchMetrics.ActionEvent(actionName);
+ }
if (remoteViews == null) {
if (mBottomBarView == null) return false;
hideBottomBar();

Powered by Google App Engine
This is Rietveld 408576698