Chromium Code Reviews| Index: chrome/browser/media/protected_media_identifier_permission_context.h |
| diff --git a/chrome/browser/media/protected_media_identifier_permission_context.h b/chrome/browser/media/protected_media_identifier_permission_context.h |
| index 58fba09724b6f1f310d3be24aab60322f11f654f..9556c7369fdc065132f112a6617cc65bb9986efd 100644 |
| --- a/chrome/browser/media/protected_media_identifier_permission_context.h |
| +++ b/chrome/browser/media/protected_media_identifier_permission_context.h |
| @@ -5,11 +5,21 @@ |
| #ifndef CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
| #define CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
| +#include "base/memory/weak_ptr.h" |
| #include "chrome/browser/content_settings/permission_context_base.h" |
| +#include "components/content_settings/core/common/permission_request_id.h" |
| + |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
| +#include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
| +#endif |
| -class PermissionRequestID; |
| class Profile; |
| +namespace views { |
| +class Widget; |
| +} |
| + |
| namespace content { |
| class RenderViewHost; |
| class WebContents; |
| @@ -26,12 +36,14 @@ class ProtectedMediaIdentifierPermissionContext |
| // valid iframes. It also adds special logic when called through an extension. |
| void RequestPermission(content::WebContents* web_contents, |
| const PermissionRequestID& id, |
| - const GURL& requesting_frame_origin, |
| + const GURL& requesting_origin, |
| bool user_gesture, |
| const BrowserPermissionCallback& callback) override; |
| ContentSetting GetPermissionStatus( |
| const GURL& requesting_origin, |
| const GURL& embedding_origin) const override; |
| + void CancelPermissionRequest(content::WebContents* web_contents, |
| + const PermissionRequestID& id) override; |
| private: |
| ~ProtectedMediaIdentifierPermissionContext() override; |
| @@ -44,6 +56,26 @@ class ProtectedMediaIdentifierPermissionContext |
| // user in the master switch in content settings, or by the device policy. |
| bool IsProtectedMediaIdentifierEnabled() const; |
| +#if defined(OS_CHROMEOS) |
| + void OnPlatformVerificationResult( |
| + const PermissionRequestID& id, |
| + const GURL& requesting_origin, |
| + const GURL& embedding_origin, |
| + const BrowserPermissionCallback& callback, |
| + chromeos::attestation::PlatformVerificationFlow::ConsentResponse |
| + response); |
| + |
| + // ID for the pending permission request. Invalid when no request is pending, |
| + // or the request has been canceled. |
| + PermissionRequestID pending_id_; |
| + |
| + views::Widget* widget_; |
| +#endif |
| + |
| + // Must be the last member, to ensure that it will be |
| + // destroyed first, which will invalidate weak pointers |
|
Jun Mukai
2015/02/05 02:08:14
I believe the callback won't run during the destru
xhwang
2015/02/05 02:49:35
hmm, can you elaborate? This comment doesn't menti
|
| + base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; |
|
Jun Mukai
2015/02/05 02:08:14
weak_factory_ is also used chromeos only, so might
xhwang
2015/02/05 02:49:35
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); |
| }; |