| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/protected_media_identifier_infobar_delegate.h" | 5 #include "chrome/browser/media/protected_media_identifier_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/permission_queue_controller.h" | 7 #include "chrome/browser/content_settings/permission_queue_controller.h" |
| 8 #include "chrome/browser/infobars/infobar.h" | 8 #include "chrome/browser/infobars/infobar.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "content/public/browser/navigation_entry.h" | 10 #include "content/public/browser/navigation_entry.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool ProtectedMediaIdentifierInfoBarDelegate::Accept() { | 57 bool ProtectedMediaIdentifierInfoBarDelegate::Accept() { |
| 58 SetPermission(true, true); | 58 SetPermission(true, true); |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void ProtectedMediaIdentifierInfoBarDelegate::SetPermission( | 62 void ProtectedMediaIdentifierInfoBarDelegate::SetPermission( |
| 63 bool update_content_setting, | 63 bool update_content_setting, |
| 64 bool allowed) { | 64 bool allowed) { |
| 65 content::WebContents* web_contents = |
| 66 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 65 controller_->OnPermissionSet(id_, requesting_frame_, | 67 controller_->OnPermissionSet(id_, requesting_frame_, |
| 66 web_contents()->GetLastCommittedURL(), | 68 web_contents->GetLastCommittedURL(), |
| 67 update_content_setting, allowed); | 69 update_content_setting, allowed); |
| 68 } | 70 } |
| 69 | 71 |
| 70 void ProtectedMediaIdentifierInfoBarDelegate::InfoBarDismissed() { | 72 void ProtectedMediaIdentifierInfoBarDelegate::InfoBarDismissed() { |
| 71 SetPermission(false, false); | 73 SetPermission(false, false); |
| 72 } | 74 } |
| 73 | 75 |
| 74 int ProtectedMediaIdentifierInfoBarDelegate::GetIconID() const { | 76 int ProtectedMediaIdentifierInfoBarDelegate::GetIconID() const { |
| 75 return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; | 77 return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; |
| 76 } | 78 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 120 |
| 119 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( | 121 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( |
| 120 WindowOpenDisposition disposition) { | 122 WindowOpenDisposition disposition) { |
| 121 #if defined(OS_ANDROID) | 123 #if defined(OS_ANDROID) |
| 122 chrome::android::ChromiumApplication::OpenProtectedContentSettings(); | 124 chrome::android::ChromiumApplication::OpenProtectedContentSettings(); |
| 123 #else | 125 #else |
| 124 NOTIMPLEMENTED(); | 126 NOTIMPLEMENTED(); |
| 125 #endif | 127 #endif |
| 126 return false; // Do not dismiss the info bar. | 128 return false; // Do not dismiss the info bar. |
| 127 } | 129 } |
| OLD | NEW |