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

Unified Diff: chrome/browser/media/media_stream_devices_controller.h

Issue 2254763002: Enable the optional permission prompt persistence toggle on grouped infobars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-infobardelegate-clean
Patch Set: Rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/media_stream_devices_controller.h
diff --git a/chrome/browser/media/media_stream_devices_controller.h b/chrome/browser/media/media_stream_devices_controller.h
index 3becc1d19c7bd93ea4fe977c4a6045446f1f766e..ec0fcbb4b85df6a7ccc56c2c0c753481c89c1b52 100644
--- a/chrome/browser/media/media_stream_devices_controller.h
+++ b/chrome/browser/media/media_stream_devices_controller.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "chrome/browser/permissions/permission_request.h"
#include "components/content_settings/core/common/content_settings.h"
+#include "content/public/browser/permission_type.h"
#include "content/public/browser/web_contents_delegate.h"
class Profile;
@@ -41,6 +42,11 @@ class MediaStreamDevicesController : public PermissionRequest {
bool IsAskingForVideo() const;
base::string16 GetMessageText() const;
+ // Returns the PermissionsType associated with the provided
+ // ContentSettingsType. |type| must be a media stream type.
xhwang 2016/08/23 18:03:58 s/|type|/|content_type|/ ?
dominickn 2016/08/23 20:13:16 Done.
+ content::PermissionType GetPermissionTypeForContentSettingsType(
+ ContentSettingsType content_type) const;
+
// Forces the permissions to be denied (without being persisted) regardless
// of what the previous state was. If the user had previously allowed the
// site video or audio access, this ignores that and informs the site it was
@@ -57,6 +63,9 @@ class MediaStreamDevicesController : public PermissionRequest {
// PermissionRequest instead of a custom infobar delegate.
void GroupedRequestFinished(bool audio_accepted, bool video_accepted);
+ bool persist() const { return persist_; }
+ void set_persist(bool persist) { persist_ = persist; }
+
// PermissionRequest:
int GetIconId() const override;
base::string16 GetMessageTextFragment() const override;
@@ -132,7 +141,7 @@ class MediaStreamDevicesController : public PermissionRequest {
content::MediaResponseCallback callback_;
// Whether the permissions granted or denied by the user should be persisted.
- bool persist_permission_changes_;
+ bool persist_;
xhwang 2016/08/23 18:03:58 nit: I found the old name is easier to understand.
dominickn 2016/08/23 20:13:16 This boolean is called |persist| throughout the pe
DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController);
};

Powered by Google App Engine
This is Rietveld 408576698