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

Unified Diff: chrome/browser/media/protected_media_identifier_infobar_delegate.cc

Issue 1343553003: permissions: make ProtectedMediaIdentiferInfoBarDelegate a subclass of PermissionInfobarDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/protected_media_identifier_infobar_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/media/protected_media_identifier_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698