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

Side by Side Diff: chrome/browser/android/media/media_throttle_infobar_delegate.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 months 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 #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 <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 : infobar_response_(UMA_THROTTLE_INFOBAR_NO_RESPONSE), 45 : infobar_response_(UMA_THROTTLE_INFOBAR_NO_RESPONSE),
46 decode_granted_callback_(callback) { 46 decode_granted_callback_(callback) {
47 } 47 }
48 48
49 MediaThrottleInfoBarDelegate::~MediaThrottleInfoBarDelegate() { 49 MediaThrottleInfoBarDelegate::~MediaThrottleInfoBarDelegate() {
50 UMA_HISTOGRAM_ENUMERATION("Media.Android.ThrottleInfobarResponse", 50 UMA_HISTOGRAM_ENUMERATION("Media.Android.ThrottleInfobarResponse",
51 infobar_response_, 51 infobar_response_,
52 UMA_THROTTLE_INFOBAR_RESPONSE_COUNT); 52 UMA_THROTTLE_INFOBAR_RESPONSE_COUNT);
53 } 53 }
54 54
55 infobars::InfoBarDelegate::InfoBarIdentifier
56 MediaThrottleInfoBarDelegate::GetIdentifier() const {
57 return MEDIA_THROTTLE_INFOBAR_DELEGATE;
58 }
59
55 MediaThrottleInfoBarDelegate* 60 MediaThrottleInfoBarDelegate*
56 MediaThrottleInfoBarDelegate::AsMediaThrottleInfoBarDelegate() { 61 MediaThrottleInfoBarDelegate::AsMediaThrottleInfoBarDelegate() {
57 return this; 62 return this;
58 } 63 }
59 64
60 base::string16 MediaThrottleInfoBarDelegate::GetMessageText() const { 65 base::string16 MediaThrottleInfoBarDelegate::GetMessageText() const {
61 return l10n_util::GetStringUTF16(IDS_MEDIA_THROTTLE_INFOBAR_TEXT); 66 return l10n_util::GetStringUTF16(IDS_MEDIA_THROTTLE_INFOBAR_TEXT);
62 } 67 }
63 68
64 int MediaThrottleInfoBarDelegate::GetIconId() const { 69 int MediaThrottleInfoBarDelegate::GetIconId() const {
(...skipping 16 matching lines...) Expand all
81 bool MediaThrottleInfoBarDelegate::Cancel() { 86 bool MediaThrottleInfoBarDelegate::Cancel() {
82 infobar_response_ = UMA_THROTTLE_INFOBAR_TRY_AGAIN; 87 infobar_response_ = UMA_THROTTLE_INFOBAR_TRY_AGAIN;
83 decode_granted_callback_.Run(true); 88 decode_granted_callback_.Run(true);
84 return true; 89 return true;
85 } 90 }
86 91
87 void MediaThrottleInfoBarDelegate::InfoBarDismissed() { 92 void MediaThrottleInfoBarDelegate::InfoBarDismissed() {
88 infobar_response_ = UMA_THROTTLE_INFOBAR_DISMISSED; 93 infobar_response_ = UMA_THROTTLE_INFOBAR_DISMISSED;
89 decode_granted_callback_.Run(false); 94 decode_granted_callback_.Run(false);
90 } 95 }
OLDNEW
« no previous file with comments | « chrome/browser/android/media/media_throttle_infobar_delegate.h ('k') | chrome/browser/apps/window_controls_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698