Index: chrome/browser/media/protected_media_identifier_infobar_delegate.cc |
diff --git a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc |
index 939838a123792a01edba2da794271914115ab6bd..e23934e0abad9bfe95237869fca7d3417bb8dfe5 100644 |
--- a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc |
+++ b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc |
@@ -22,22 +22,21 @@ infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( |
const PermissionRequestID& id, |
const GURL& requesting_frame, |
const std::string& display_languages) { |
- return infobar_service->AddInfoBar( |
- infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( |
+ return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
+ scoped_ptr<ConfirmInfoBarDelegate>( |
new ProtectedMediaIdentifierInfoBarDelegate( |
controller, id, requesting_frame, display_languages)))); |
} |
- |
ProtectedMediaIdentifierInfoBarDelegate:: |
ProtectedMediaIdentifierInfoBarDelegate( |
PermissionQueueController* controller, |
const PermissionRequestID& id, |
const GURL& requesting_frame, |
const std::string& display_languages) |
- : ConfirmInfoBarDelegate(), |
- controller_(controller), |
- id_(id), |
+ : PermissionInfobarDelegate( |
+ controller, id, requesting_frame, |
+ CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER), |
requesting_frame_(requesting_frame), |
display_languages_(display_languages) { |
} |
@@ -46,34 +45,10 @@ ProtectedMediaIdentifierInfoBarDelegate:: |
~ProtectedMediaIdentifierInfoBarDelegate() { |
} |
-bool ProtectedMediaIdentifierInfoBarDelegate::Accept() { |
- SetPermission(true, true); |
- return true; |
-} |
- |
-void ProtectedMediaIdentifierInfoBarDelegate::SetPermission( |
- bool update_content_setting, |
- bool allowed) { |
- content::WebContents* web_contents = |
- InfoBarService::WebContentsFromInfoBar(infobar()); |
- controller_->OnPermissionSet(id_, requesting_frame_, |
- web_contents->GetLastCommittedURL().GetOrigin(), |
- update_content_setting, allowed); |
-} |
- |
-infobars::InfoBarDelegate::Type |
-ProtectedMediaIdentifierInfoBarDelegate::GetInfoBarType() const { |
- return PAGE_ACTION_TYPE; |
-} |
- |
int ProtectedMediaIdentifierInfoBarDelegate::GetIconId() const { |
return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; |
} |
-void ProtectedMediaIdentifierInfoBarDelegate::InfoBarDismissed() { |
- SetPermission(false, false); |
-} |
- |
base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetMessageText() const { |
return l10n_util::GetStringFUTF16( |
IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, |
@@ -81,18 +56,6 @@ base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetMessageText() const { |
display_languages_)); |
} |
-base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetButtonLabel( |
- InfoBarButton button) const { |
- return l10n_util::GetStringUTF16((button == BUTTON_OK) ? |
- IDS_PROTECTED_MEDIA_IDENTIFIER_ALLOW_BUTTON : |
- IDS_PROTECTED_MEDIA_IDENTIFIER_DENY_BUTTON); |
-} |
- |
-bool ProtectedMediaIdentifierInfoBarDelegate::Cancel() { |
- SetPermission(true, false); |
- return true; |
-} |
- |
base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { |
return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
} |