OLD | NEW |
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.tab; | 5 package org.chromium.chrome.browser.tab; |
6 | 6 |
7 import android.os.SystemClock; | 7 import android.os.SystemClock; |
8 | 8 |
9 import org.chromium.base.metrics.RecordHistogram; | 9 import org.chromium.base.metrics.RecordHistogram; |
10 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; | 10 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // TAB_STATE_* are for TabStateTransferTime and TabTransferTarget histograms
. | 46 // TAB_STATE_* are for TabStateTransferTime and TabTransferTarget histograms
. |
47 // TabState defined in tools/metrics/histograms/histograms.xml. | 47 // TabState defined in tools/metrics/histograms/histograms.xml. |
48 private static final int TAB_STATE_INITIAL = 0; | 48 private static final int TAB_STATE_INITIAL = 0; |
49 private static final int TAB_STATE_ACTIVE = 1; | 49 private static final int TAB_STATE_ACTIVE = 1; |
50 private static final int TAB_STATE_INACTIVE = 2; | 50 private static final int TAB_STATE_INACTIVE = 2; |
51 private static final int TAB_STATE_DETACHED = 3; | 51 private static final int TAB_STATE_DETACHED = 3; |
52 private static final int TAB_STATE_CLOSED = 4; | 52 private static final int TAB_STATE_CLOSED = 4; |
53 private static final int TAB_STATE_MAX = TAB_STATE_CLOSED; | 53 private static final int TAB_STATE_MAX = TAB_STATE_CLOSED; |
54 | 54 |
55 // Counter of tab shows (as per onShow()) for all tabs. | 55 // Counter of tab shows (as per onShow()) for all tabs. |
56 private static long sAllTabsShowCount = 0; | 56 private static long sAllTabsShowCount; |
57 | 57 |
58 /** | 58 /** |
59 * State in which the tab was created. This can be used in metric accounting
- e.g. to | 59 * State in which the tab was created. This can be used in metric accounting
- e.g. to |
60 * distinguish reasons for a tab to be restored upon first display. | 60 * distinguish reasons for a tab to be restored upon first display. |
61 */ | 61 */ |
62 public enum TabCreationState { | 62 public enum TabCreationState { |
63 LIVE_IN_FOREGROUND, | 63 LIVE_IN_FOREGROUND, |
64 LIVE_IN_BACKGROUND, | 64 LIVE_IN_BACKGROUND, |
65 FROZEN_ON_RESTORE, | 65 FROZEN_ON_RESTORE, |
66 FROZEN_FOR_LAZY_LOAD, | 66 FROZEN_FOR_LAZY_LOAD, |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 384 } |
385 | 385 |
386 private static void increaseTabShowCount() { | 386 private static void increaseTabShowCount() { |
387 sAllTabsShowCount++; | 387 sAllTabsShowCount++; |
388 } | 388 } |
389 | 389 |
390 private static long millisecondsToMinutes(long msec) { | 390 private static long millisecondsToMinutes(long msec) { |
391 return msec / 1000 / 60; | 391 return msec / 1000 / 60; |
392 } | 392 } |
393 } | 393 } |
OLD | NEW |