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

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

Issue 1392913003: Add warning icon to media throttle info bar to make it consistent with others (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « chrome/browser/android/media/media_throttle_infobar_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/infobars/infobar_service.h" 7 #include "chrome/browser/infobars/infobar_service.h"
8 #include "chrome/grit/generated_resources.h" 8 #include "chrome/grit/generated_resources.h"
9 #include "components/infobars/core/infobar.h" 9 #include "components/infobars/core/infobar.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 MediaThrottleInfoBarDelegate* 46 MediaThrottleInfoBarDelegate*
47 MediaThrottleInfoBarDelegate::AsMediaThrottleInfoBarDelegate() { 47 MediaThrottleInfoBarDelegate::AsMediaThrottleInfoBarDelegate() {
48 return this; 48 return this;
49 } 49 }
50 50
51 base::string16 MediaThrottleInfoBarDelegate::GetMessageText() const { 51 base::string16 MediaThrottleInfoBarDelegate::GetMessageText() const {
52 return l10n_util::GetStringUTF16(IDS_MEDIA_THROTTLE_INFOBAR_TEXT); 52 return l10n_util::GetStringUTF16(IDS_MEDIA_THROTTLE_INFOBAR_TEXT);
53 } 53 }
54 54
55 int MediaThrottleInfoBarDelegate::GetIconId() const {
56 return IDR_INFOBAR_WARNING;
57 }
58
55 base::string16 MediaThrottleInfoBarDelegate::GetButtonLabel( 59 base::string16 MediaThrottleInfoBarDelegate::GetButtonLabel(
56 InfoBarButton button) const { 60 InfoBarButton button) const {
57 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? 61 return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
58 IDS_MEDIA_THROTTLE_INFOBAR_BLOCK_BUTTON : 62 IDS_MEDIA_THROTTLE_INFOBAR_BLOCK_BUTTON :
59 IDS_MEDIA_THROTTLE_INFOBAR_ALLOW_BUTTON); 63 IDS_MEDIA_THROTTLE_INFOBAR_ALLOW_BUTTON);
60 } 64 }
61 65
62 bool MediaThrottleInfoBarDelegate::Accept() { 66 bool MediaThrottleInfoBarDelegate::Accept() {
63 decode_granted_callback_.Run(false); 67 decode_granted_callback_.Run(false);
64 return true; 68 return true;
65 } 69 }
66 70
67 bool MediaThrottleInfoBarDelegate::Cancel() { 71 bool MediaThrottleInfoBarDelegate::Cancel() {
68 decode_granted_callback_.Run(true); 72 decode_granted_callback_.Run(true);
69 return true; 73 return true;
70 } 74 }
71 75
72 void MediaThrottleInfoBarDelegate::InfoBarDismissed() { 76 void MediaThrottleInfoBarDelegate::InfoBarDismissed() {
73 decode_granted_callback_.Run(false); 77 decode_granted_callback_.Run(false);
74 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/android/media/media_throttle_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698