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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java

Issue 2557513007: ntp_tiles::metrics: Add rappor metrics for impression URLs per icon type. (Closed)
Patch Set: Addressed comments. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.ntp; 5 package org.chromium.chrome.browser.ntp;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.content.Context; 8 import android.content.Context;
9 import android.graphics.Canvas; 9 import android.graphics.Canvas;
10 import android.graphics.Point; 10 import android.graphics.Point;
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 RecordHistogram.recordTimesHistogram( 630 RecordHistogram.recordTimesHistogram(
631 "Tab.NewTabOnload", loadTimeMs, TimeUnit.MILLISECONDS); 631 "Tab.NewTabOnload", loadTimeMs, TimeUnit.MILLISECONDS);
632 mIsLoaded = true; 632 mIsLoaded = true;
633 StartupMetrics.getInstance().recordOpenedNTP(); 633 StartupMetrics.getInstance().recordOpenedNTP();
634 NewTabPageUma.recordNTPImpression(NewTabPageUma.NTP_IMPRESSION_REGUL AR); 634 NewTabPageUma.recordNTPImpression(NewTabPageUma.NTP_IMPRESSION_REGUL AR);
635 // If not visible when loading completes, wait until onShown is rece ived. 635 // If not visible when loading completes, wait until onShown is rece ived.
636 if (!mTab.isHidden()) recordNTPShown(); 636 if (!mTab.isHidden()) recordNTPShown();
637 637
638 int tileTypes[] = new int[items.length]; 638 int tileTypes[] = new int[items.length];
639 int sources[] = new int[items.length]; 639 int sources[] = new int[items.length];
640 String tileUrls[] = new String[items.length];
640 641
641 for (int i = 0; i < items.length; i++) { 642 for (int i = 0; i < items.length; i++) {
642 tileTypes[i] = items[i].getTileType(); 643 tileTypes[i] = items[i].getTileType();
643 sources[i] = items[i].getSource(); 644 sources[i] = items[i].getSource();
645 tileUrls[i] = items[i].getUrl();
644 } 646 }
645 647
646 mMostVisitedSites.recordPageImpression(tileTypes, sources); 648 mMostVisitedSites.recordPageImpression(tileTypes, sources, tileUrls) ;
647 649
648 if (isNtpOfflinePagesEnabled()) { 650 if (isNtpOfflinePagesEnabled()) {
649 final int maxNumTiles = 12; 651 final int maxNumTiles = 12;
650 for (int i = 0; i < items.length; i++) { 652 for (int i = 0; i < items.length; i++) {
651 if (items[i].isOfflineAvailable()) { 653 if (items[i].isOfflineAvailable()) {
652 RecordHistogram.recordEnumeratedHistogram( 654 RecordHistogram.recordEnumeratedHistogram(
653 "NewTabPage.TileOfflineAvailable", i, maxNumTile s); 655 "NewTabPage.TileOfflineAvailable", i, maxNumTile s);
654 } 656 }
655 } 657 }
656 } 658 }
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 @Override 1038 @Override
1037 public boolean shouldCaptureThumbnail() { 1039 public boolean shouldCaptureThumbnail() {
1038 return mNewTabPageView.shouldCaptureThumbnail(); 1040 return mNewTabPageView.shouldCaptureThumbnail();
1039 } 1041 }
1040 1042
1041 @Override 1043 @Override
1042 public void captureThumbnail(Canvas canvas) { 1044 public void captureThumbnail(Canvas canvas) {
1043 mNewTabPageView.captureThumbnail(canvas); 1045 mNewTabPageView.captureThumbnail(canvas);
1044 } 1046 }
1045 } 1047 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698