| 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 #include "chrome/browser/android/media/media_throttle_infobar_delegate.h" | 5 #include "chrome/browser/android/media/media_throttle_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 : infobar_response_(UMA_THROTTLE_INFOBAR_NO_RESPONSE), | 42 : infobar_response_(UMA_THROTTLE_INFOBAR_NO_RESPONSE), |
| 43 decode_granted_callback_(callback) { | 43 decode_granted_callback_(callback) { |
| 44 } | 44 } |
| 45 | 45 |
| 46 MediaThrottleInfoBarDelegate::~MediaThrottleInfoBarDelegate() { | 46 MediaThrottleInfoBarDelegate::~MediaThrottleInfoBarDelegate() { |
| 47 UMA_HISTOGRAM_ENUMERATION("Media.Android.ThrottleInfobarResponse", | 47 UMA_HISTOGRAM_ENUMERATION("Media.Android.ThrottleInfobarResponse", |
| 48 infobar_response_, | 48 infobar_response_, |
| 49 UMA_THROTTLE_INFOBAR_RESPONSE_COUNT); | 49 UMA_THROTTLE_INFOBAR_RESPONSE_COUNT); |
| 50 } | 50 } |
| 51 | 51 |
| 52 std::string MediaThrottleInfoBarDelegate::GetIdentifier() const { |
| 53 return "MediaThrottleInfoBarDelegate"; |
| 54 } |
| 55 |
| 52 MediaThrottleInfoBarDelegate* | 56 MediaThrottleInfoBarDelegate* |
| 53 MediaThrottleInfoBarDelegate::AsMediaThrottleInfoBarDelegate() { | 57 MediaThrottleInfoBarDelegate::AsMediaThrottleInfoBarDelegate() { |
| 54 return this; | 58 return this; |
| 55 } | 59 } |
| 56 | 60 |
| 57 base::string16 MediaThrottleInfoBarDelegate::GetMessageText() const { | 61 base::string16 MediaThrottleInfoBarDelegate::GetMessageText() const { |
| 58 return l10n_util::GetStringUTF16(IDS_MEDIA_THROTTLE_INFOBAR_TEXT); | 62 return l10n_util::GetStringUTF16(IDS_MEDIA_THROTTLE_INFOBAR_TEXT); |
| 59 } | 63 } |
| 60 | 64 |
| 61 int MediaThrottleInfoBarDelegate::GetIconId() const { | 65 int MediaThrottleInfoBarDelegate::GetIconId() const { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 bool MediaThrottleInfoBarDelegate::Cancel() { | 82 bool MediaThrottleInfoBarDelegate::Cancel() { |
| 79 infobar_response_ = UMA_THROTTLE_INFOBAR_TRY_AGAIN; | 83 infobar_response_ = UMA_THROTTLE_INFOBAR_TRY_AGAIN; |
| 80 decode_granted_callback_.Run(true); | 84 decode_granted_callback_.Run(true); |
| 81 return true; | 85 return true; |
| 82 } | 86 } |
| 83 | 87 |
| 84 void MediaThrottleInfoBarDelegate::InfoBarDismissed() { | 88 void MediaThrottleInfoBarDelegate::InfoBarDismissed() { |
| 85 infobar_response_ = UMA_THROTTLE_INFOBAR_DISMISSED; | 89 infobar_response_ = UMA_THROTTLE_INFOBAR_DISMISSED; |
| 86 decode_granted_callback_.Run(false); | 90 decode_granted_callback_.Run(false); |
| 87 } | 91 } |
| OLD | NEW |