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

Side by Side Diff: chrome/browser/media/protected_media_identifier_permission_context.h

Issue 1001723002: media: Refactor PlatformVerificationFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ 6 #define CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_
7 7
8 #include "chrome/browser/content_settings/permission_context_base.h" 8 #include "chrome/browser/content_settings/permission_context_base.h"
9 #include "components/content_settings/core/common/permission_request_id.h" 9 #include "components/content_settings/core/common/permission_request_id.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void CancelPermissionRequest(content::WebContents* web_contents, 47 void CancelPermissionRequest(content::WebContents* web_contents,
48 const PermissionRequestID& id) override; 48 const PermissionRequestID& id) override;
49 49
50 private: 50 private:
51 ~ProtectedMediaIdentifierPermissionContext() override; 51 ~ProtectedMediaIdentifierPermissionContext() override;
52 52
53 void UpdateTabContext(const PermissionRequestID& id, 53 void UpdateTabContext(const PermissionRequestID& id,
54 const GURL& requesting_frame, 54 const GURL& requesting_frame,
55 bool allowed) override; 55 bool allowed) override;
56 56
57 // Returns whether "Protected content" is enabled. It can be disabled by a 57 // Returns whether "Protected content" is enabled considering factors other
ddorwin 2015/03/12 00:28:32 nit: comma after enabled. Or, perhaps s/considerin
58 // user in the master switch in content settings, or by the device policy. 58 // than the protected media identifier content setting itself. For example,
59 // it can be disabled by a master switch in content settings, in incognito or
ddorwin 2015/03/12 00:28:32 tiny nit: Capital I and G
60 // guest mode, or by the device policy.
59 bool IsProtectedMediaIdentifierEnabled() const; 61 bool IsProtectedMediaIdentifierEnabled() const;
60 62
61 #if defined(OS_CHROMEOS) 63 #if defined(OS_CHROMEOS)
62 void OnPlatformVerificationResult( 64 void OnPlatformVerificationConsentResponse(
63 content::WebContents* web_contents, 65 content::WebContents* web_contents,
64 const PermissionRequestID& id, 66 const PermissionRequestID& id,
65 const GURL& requesting_origin, 67 const GURL& requesting_origin,
66 const GURL& embedding_origin, 68 const GURL& embedding_origin,
67 const BrowserPermissionCallback& callback, 69 const BrowserPermissionCallback& callback,
68 chromeos::attestation::PlatformVerificationFlow::ConsentResponse 70 chromeos::attestation::PlatformVerificationDialog::ConsentResponse
69 response); 71 response);
70 72
71 // |this| is shared among multiple WebContents, so we could receive multiple 73 // |this| is shared among multiple WebContents, so we could receive multiple
72 // permission requests. This map tracks all pending requests. Note that we 74 // permission requests. This map tracks all pending requests. Note that we
73 // only allow one request per WebContents. 75 // only allow one request per WebContents.
74 typedef std::map<content::WebContents*, 76 typedef std::map<content::WebContents*,
75 std::pair<views::Widget*, PermissionRequestID>> 77 std::pair<views::Widget*, PermissionRequestID>>
76 PendingRequestMap; 78 PendingRequestMap;
77 PendingRequestMap pending_requests_; 79 PendingRequestMap pending_requests_;
78 80
79 // Must be the last member, to ensure that it will be 81 // Must be the last member, to ensure that it will be
80 // destroyed first, which will invalidate weak pointers 82 // destroyed first, which will invalidate weak pointers
81 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; 83 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_;
82 #endif 84 #endif
83 85
84 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); 86 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext);
85 }; 87 };
86 88
87 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ 89 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698