Chromium Code Reviews| 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(); |