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

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

Issue 10537099: add "always allow" option to the mediastream infobar and allow user to allow/not allow acces to devi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/media_stream_devices_menu_model.h
diff --git a/chrome/browser/media/media_stream_devices_menu_model.h b/chrome/browser/media/media_stream_devices_menu_model.h
index 866234762ad63d7a7610e9ddb6a9d8ccd69fdcd8..8598faedbceaea1b2b10fca0c33541f850c2699c 100644
--- a/chrome/browser/media/media_stream_devices_menu_model.h
+++ b/chrome/browser/media/media_stream_devices_menu_model.h
@@ -19,8 +19,7 @@ class MediaStreamInfoBarDelegate;
class MediaStreamDevicesMenuModel : public ui::SimpleMenuModel,
public ui::SimpleMenuModel::Delegate {
public:
- explicit MediaStreamDevicesMenuModel(
- const MediaStreamInfoBarDelegate* delegate);
+ explicit MediaStreamDevicesMenuModel(MediaStreamInfoBarDelegate* delegate);
virtual ~MediaStreamDevicesMenuModel();
// Returns the |device_id| for the selected device of type |type|. Returns
@@ -30,6 +29,8 @@ class MediaStreamDevicesMenuModel : public ui::SimpleMenuModel,
content::MediaStreamDeviceType type,
std::string* device_id) const;
+ bool IsAlwaysAllowChecked() { return always_allow_; }
tommi (sloooow) - chröme 2012/06/11 20:59:21 bool always_allow() const?
no longer working on chromium 2012/06/14 13:03:25 Done.
+
// ui::SimpleMenuModel::Delegate implementation:
virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
@@ -44,14 +45,21 @@ class MediaStreamDevicesMenuModel : public ui::SimpleMenuModel,
// Internal method to add the |devices| to the current menu.
void AddDevices(const content::MediaStreamDevices& devices);
+ // Internal method to add "always" and "never" options to the current menu.
+ void AddAlwaysAndNeverOptions(bool audio, bool video);
+
// Map of command IDs to devices.
CommandMap commands_;
+ MediaStreamInfoBarDelegate* media_stream_delegate_;
tommi (sloooow) - chröme 2012/06/11 20:59:21 document ownership
no longer working on chromium 2012/06/14 13:03:25 Uncleaned debugging code. Remove now.
+
// These are the command IDs (key of above |commands_| map) of the selected
// devices entries in the menu, or -1 if there is no selected ID.
int selected_command_id_audio_;
int selected_command_id_video_;
+ bool always_allow_;
+
DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesMenuModel);
};

Powered by Google App Engine
This is Rietveld 408576698