OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_STREAM_DEVICES_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Public methods to be called by MediaStreamInfoBarDelegate; | 67 // Public methods to be called by MediaStreamInfoBarDelegate; |
68 bool HasAudio() const; | 68 bool HasAudio() const; |
69 bool HasVideo() const; | 69 bool HasVideo() const; |
70 const std::string& GetSecurityOriginSpec() const; | 70 const std::string& GetSecurityOriginSpec() const; |
71 void Accept(bool update_content_setting); | 71 void Accept(bool update_content_setting); |
72 void Deny(bool update_content_setting, | 72 void Deny(bool update_content_setting, |
73 content::MediaStreamRequestResult result); | 73 content::MediaStreamRequestResult result); |
74 | 74 |
75 // PermissionBubbleRequest: | 75 // PermissionBubbleRequest: |
76 virtual int GetIconID() const OVERRIDE; | 76 virtual int GetIconID() const override; |
77 virtual base::string16 GetMessageText() const OVERRIDE; | 77 virtual base::string16 GetMessageText() const override; |
78 virtual base::string16 GetMessageTextFragment() const OVERRIDE; | 78 virtual base::string16 GetMessageTextFragment() const override; |
79 virtual bool HasUserGesture() const OVERRIDE; | 79 virtual bool HasUserGesture() const override; |
80 virtual GURL GetRequestingHostname() const OVERRIDE; | 80 virtual GURL GetRequestingHostname() const override; |
81 virtual void PermissionGranted() OVERRIDE; | 81 virtual void PermissionGranted() override; |
82 virtual void PermissionDenied() OVERRIDE; | 82 virtual void PermissionDenied() override; |
83 virtual void Cancelled() OVERRIDE; | 83 virtual void Cancelled() override; |
84 virtual void RequestFinished() OVERRIDE; | 84 virtual void RequestFinished() override; |
85 | 85 |
86 private: | 86 private: |
87 // Returns true if the origin of the request has been granted the media | 87 // Returns true if the origin of the request has been granted the media |
88 // access before, otherwise returns false. | 88 // access before, otherwise returns false. |
89 bool IsRequestAllowedByDefault() const; | 89 bool IsRequestAllowedByDefault() const; |
90 | 90 |
91 // Check if any device of the request has been blocked for the origin of the | 91 // Check if any device of the request has been blocked for the origin of the |
92 // request and clears |microphone_requested_| or |webcam_requested_| flags if | 92 // request and clears |microphone_requested_| or |webcam_requested_| flags if |
93 // they are not allowed anymore. Returns the number of devices that are | 93 // they are not allowed anymore. Returns the number of devices that are |
94 // allowed after this step. If the count reaches zero the request can be | 94 // allowed after this step. If the count reaches zero the request can be |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // passed to the tab specific content settings when the permissions have been | 150 // passed to the tab specific content settings when the permissions have been |
151 // resolved. Currently only used by MEDIA_DEVICE_AUDIO_CAPTURE and | 151 // resolved. Currently only used by MEDIA_DEVICE_AUDIO_CAPTURE and |
152 // MEDIA_DEVICE_VIDEO_CAPTURE since those are the only types that require | 152 // MEDIA_DEVICE_VIDEO_CAPTURE since those are the only types that require |
153 // updates in the settings. | 153 // updates in the settings. |
154 MediaStreamTypeSettingsMap request_permissions_; | 154 MediaStreamTypeSettingsMap request_permissions_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); | 156 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); |
157 }; | 157 }; |
158 | 158 |
159 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 159 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
OLD | NEW |