Chromium Code Reviews| 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..6d9d05059d36e206b79738aabc822315fc20f316 100644 |
| --- a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc |
| +++ b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc |
| @@ -5,7 +5,6 @@ |
| #include "chrome/browser/media/protected_media_identifier_infobar_delegate.h" |
| #include "chrome/browser/infobars/infobar_service.h" |
| -#include "chrome/browser/permissions/permission_queue_controller.h" |
| #include "chrome/browser/permissions/permission_request_id.h" |
| #include "chrome/common/url_constants.h" |
| #include "chrome/grit/generated_resources.h" |
| @@ -18,28 +17,27 @@ |
| // static |
| infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( |
| InfoBarService* infobar_service, |
| - PermissionQueueController* controller, |
| const PermissionRequestID& id, |
| const GURL& requesting_frame, |
| - const std::string& display_languages) { |
| + const std::string& display_languages, |
| + const base::Callback<void(bool, bool)>& callback) { |
| return infobar_service->AddInfoBar( |
| infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( |
| new ProtectedMediaIdentifierInfoBarDelegate( |
| - controller, id, requesting_frame, display_languages)))); |
| + id, requesting_frame, display_languages, callback)))); |
| } |
| - |
| ProtectedMediaIdentifierInfoBarDelegate:: |
| ProtectedMediaIdentifierInfoBarDelegate( |
| - PermissionQueueController* controller, |
| const PermissionRequestID& id, |
| const GURL& requesting_frame, |
| - const std::string& display_languages) |
| + const std::string& display_languages, |
| + const base::Callback<void(bool, bool)>& callback) |
| : ConfirmInfoBarDelegate(), |
| - controller_(controller), |
| id_(id), |
| requesting_frame_(requesting_frame), |
| - display_languages_(display_languages) { |
| + display_languages_(display_languages), |
| + callback_(callback) { |
| } |
| ProtectedMediaIdentifierInfoBarDelegate:: |
| @@ -54,11 +52,7 @@ bool ProtectedMediaIdentifierInfoBarDelegate::Accept() { |
| void ProtectedMediaIdentifierInfoBarDelegate::SetPermission( |
|
mlamouri (slow - plz ping)
2015/09/15 12:55:59
Why is that needed? Could it directly inherits fro
Lalit Maganti
2015/09/15 13:16:53
IDK why but right now it does not inherit from Per
Lalit Maganti
2015/09/15 14:19:24
Done.
|
| 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); |
| + callback_.Run(update_content_setting, allowed); |
| } |
| infobars::InfoBarDelegate::Type |