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

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

Issue 1828803003: Media permissions: Remove plumbing for insecure pepper requests in Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and fix tests Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/media/media_permission.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_MEDIA_PERMISSION_H_ 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_PERMISSION_H_
6 #define CHROME_BROWSER_MEDIA_MEDIA_PERMISSION_H_ 6 #define CHROME_BROWSER_MEDIA_MEDIA_PERMISSION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/content_settings/core/common/content_settings.h" 11 #include "components/content_settings/core/common/content_settings.h"
12 #include "components/content_settings/core/common/content_settings_types.h" 12 #include "components/content_settings/core/common/content_settings_types.h"
13 #include "content/public/common/media_stream_request.h" 13 #include "content/public/common/media_stream_request.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 class MediaStreamDevicePermissionContext; 16 class MediaStreamDevicePermissionContext;
17 class Profile; 17 class Profile;
18 18
19 // Represents a permission for microphone/camera access. 19 // Represents a permission for microphone/camera access.
20 class MediaPermission { 20 class MediaPermission {
21 public: 21 public:
22 // TODO(raymes): After crbug.com/526324 has been fixed, remove
23 // |is_insecure_pepper_request| from the constructor.
24 MediaPermission(ContentSettingsType content_type, 22 MediaPermission(ContentSettingsType content_type,
25 bool is_insecure_pepper_request,
26 const GURL& requesting_origin, 23 const GURL& requesting_origin,
27 const GURL& embedding_origin, 24 const GURL& embedding_origin,
28 Profile* profile); 25 Profile* profile);
29 26
30 // Returns the status of the permission. If the setting is 27 // Returns the status of the permission. If the setting is
31 // CONTENT_SETTING_BLOCK, |denial_reason| will output the reason for it being 28 // CONTENT_SETTING_BLOCK, |denial_reason| will output the reason for it being
32 // blocked. 29 // blocked.
33 ContentSetting GetPermissionStatus( 30 ContentSetting GetPermissionStatus(
34 content::MediaStreamRequestResult* denial_reason) const; 31 content::MediaStreamRequestResult* denial_reason) const;
35 32
36 // Returns the status of the permission as with GetPermissionStatus but also 33 // Returns the status of the permission as with GetPermissionStatus but also
37 // checks that the specified |device_id| is an available device. 34 // checks that the specified |device_id| is an available device.
38 ContentSetting GetPermissionStatusWithDeviceRequired( 35 ContentSetting GetPermissionStatusWithDeviceRequired(
39 const std::string& device_id, 36 const std::string& device_id,
40 content::MediaStreamRequestResult* denial_reason) const; 37 content::MediaStreamRequestResult* denial_reason) const;
41 38
42 private: 39 private:
43 ContentSetting GetStoredContentSetting( 40 ContentSetting GetStoredContentSetting(
44 MediaStreamDevicePermissionContext* media_device_permission_context) 41 MediaStreamDevicePermissionContext* media_device_permission_context)
45 const; 42 const;
46 bool HasAvailableDevices(const std::string& device_id) const; 43 bool HasAvailableDevices(const std::string& device_id) const;
47 44
48 const ContentSettingsType content_type_; 45 const ContentSettingsType content_type_;
49 bool is_insecure_pepper_request_;
50 const GURL requesting_origin_; 46 const GURL requesting_origin_;
51 const GURL embedding_origin_; 47 const GURL embedding_origin_;
52 const std::string device_id_; 48 const std::string device_id_;
53 Profile* const profile_; 49 Profile* const profile_;
54 50
55 DISALLOW_COPY_AND_ASSIGN(MediaPermission); 51 DISALLOW_COPY_AND_ASSIGN(MediaPermission);
56 }; 52 };
57 53
58 #endif // CHROME_BROWSER_MEDIA_MEDIA_PERMISSION_H_ 54 #endif // CHROME_BROWSER_MEDIA_MEDIA_PERMISSION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/media_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698