Chromium Code Reviews| 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.snackbar; | 5 package org.chromium.chrome.browser.snackbar; |
| 6 | 6 |
| 7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
| 8 | 8 |
| 9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
| 10 import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; | 10 import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 public static final int TYPE_ACTION = 0; | 26 public static final int TYPE_ACTION = 0; |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * Snackbars that are for notification purposes. These snackbars are stored in a queue and thus | 29 * Snackbars that are for notification purposes. These snackbars are stored in a queue and thus |
| 30 * are of lower priority, compared to {@link #TYPE_ACTION}. Notification sna ckbars are dismissed | 30 * are of lower priority, compared to {@link #TYPE_ACTION}. Notification sna ckbars are dismissed |
| 31 * one by one. | 31 * one by one. |
| 32 */ | 32 */ |
| 33 public static final int TYPE_NOTIFICATION = 1; | 33 public static final int TYPE_NOTIFICATION = 1; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * UMA Identifiers of features using snackbar. See SnackbarIdentifier enum i n histograms. | 36 * UMA Identifiers of features using snackbar. See SnackbarIdentifier enum i n histograms. |
|
gone
2017/04/26 17:27:02
The comment here says you need to edit histograms.
ramyasharma
2017/04/27 08:03:11
Oops. Thanks for pointing that. Done.
| |
| 37 */ | 37 */ |
| 38 public static final int UMA_TEST_SNACKBAR = -2; | 38 public static final int UMA_TEST_SNACKBAR = -2; |
| 39 public static final int UMA_UNKNOWN = -1; | 39 public static final int UMA_UNKNOWN = -1; |
| 40 public static final int UMA_BOOKMARK_ADDED = 0; | 40 public static final int UMA_BOOKMARK_ADDED = 0; |
| 41 public static final int UMA_BOOKMARK_DELETE_UNDO = 1; | 41 public static final int UMA_BOOKMARK_DELETE_UNDO = 1; |
| 42 public static final int UMA_NTP_MOST_VISITED_DELETE_UNDO = 2; | 42 public static final int UMA_NTP_MOST_VISITED_DELETE_UNDO = 2; |
| 43 public static final int UMA_OFFLINE_PAGE_RELOAD = 3; | 43 public static final int UMA_OFFLINE_PAGE_RELOAD = 3; |
| 44 public static final int UMA_AUTO_LOGIN = 4; | 44 public static final int UMA_AUTO_LOGIN = 4; |
| 45 public static final int UMA_OMNIBOX_GEOLOCATION = 5; | 45 public static final int UMA_OMNIBOX_GEOLOCATION = 5; |
| 46 public static final int UMA_LOFI = 6; | 46 public static final int UMA_LOFI = 6; |
| 47 public static final int UMA_DATA_USE_STARTED = 7; | 47 public static final int UMA_DATA_USE_STARTED = 7; |
| 48 public static final int UMA_DATA_USE_ENDED = 8; | 48 public static final int UMA_DATA_USE_ENDED = 8; |
| 49 public static final int UMA_DOWNLOAD_SUCCEEDED = 9; | 49 public static final int UMA_DOWNLOAD_SUCCEEDED = 9; |
| 50 public static final int UMA_DOWNLOAD_FAILED = 10; | 50 public static final int UMA_DOWNLOAD_FAILED = 10; |
| 51 public static final int UMA_TAB_CLOSE_UNDO = 11; | 51 public static final int UMA_TAB_CLOSE_UNDO = 11; |
| 52 public static final int UMA_TAB_CLOSE_ALL_UNDO = 12; | 52 public static final int UMA_TAB_CLOSE_ALL_UNDO = 12; |
| 53 public static final int UMA_DOWNLOAD_DELETE_UNDO = 13; | 53 public static final int UMA_DOWNLOAD_DELETE_UNDO = 13; |
| 54 public static final int UMA_SPECIAL_LOCALE = 14; | 54 public static final int UMA_SPECIAL_LOCALE = 14; |
| 55 // Obsolete; don't use: UMA_BLIMP = 15; | 55 // Obsolete; don't use: UMA_BLIMP = 15; |
| 56 public static final int UMA_DATA_REDUCTION_PROMO = 16; | 56 public static final int UMA_DATA_REDUCTION_PROMO = 16; |
| 57 public static final int UMA_HISTORY_LINK_COPIED = 17; | 57 public static final int UMA_HISTORY_LINK_COPIED = 17; |
| 58 public static final int UMA_TRANSLATE_ALWAYS = 18; | |
| 59 public static final int UMA_TRANSLATE_NEVER = 19; | |
| 60 public static final int UMA_TRANSLATE_NEVER_SITE = 20; | |
| 58 | 61 |
| 59 private SnackbarController mController; | 62 private SnackbarController mController; |
| 60 private CharSequence mText; | 63 private CharSequence mText; |
| 61 private String mTemplateText; | 64 private String mTemplateText; |
| 62 private String mActionText; | 65 private String mActionText; |
| 63 private Object mActionData; | 66 private Object mActionData; |
| 64 private int mBackgroundColor; | 67 private int mBackgroundColor; |
| 65 private boolean mSingleLine = true; | 68 private boolean mSingleLine = true; |
| 66 private int mDurationMs; | 69 private int mDurationMs; |
| 67 private Bitmap mProfileImage; | 70 private Bitmap mProfileImage; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 return mProfileImage; | 200 return mProfileImage; |
| 198 } | 201 } |
| 199 | 202 |
| 200 /** | 203 /** |
| 201 * @return Whether the snackbar is of {@link #TYPE_ACTION}. | 204 * @return Whether the snackbar is of {@link #TYPE_ACTION}. |
| 202 */ | 205 */ |
| 203 boolean isTypeAction() { | 206 boolean isTypeAction() { |
| 204 return mType == TYPE_ACTION; | 207 return mType == TYPE_ACTION; |
| 205 } | 208 } |
| 206 } | 209 } |
| OLD | NEW |