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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.h

Issue 12208010: Adding device selection menus to the content setting bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed the final comments. Created 7 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.h
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.h b/chrome/browser/ui/content_settings/content_setting_bubble_model.h
index 5d0a67992eb2d882236ef6088676b1d63e4fc10a..9ac50965f207b500eb8b6135a12f42e414fb160c 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.h
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
#define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
+#include <map>
#include <set>
#include <string>
#include <vector>
@@ -14,6 +15,7 @@
#include "chrome/common/custom_handlers/protocol_handler.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/common/media_stream_request.h"
#include "googleurl/src/gurl.h"
#include "ui/gfx/image/image.h"
@@ -57,6 +59,13 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
std::set<std::string> hosts;
};
+ struct MediaMenu {
+ std::string label;
+ content::MediaStreamDevice default_device;
+ content::MediaStreamDevice selected_device;
+ };
+ typedef std::map<content::MediaStreamType, MediaMenu> MediaMenuMap;
+
struct BubbleContent {
BubbleContent();
~BubbleContent();
@@ -70,6 +79,7 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
std::string custom_link;
bool custom_link_enabled;
std::string manage_link;
+ MediaMenuMap media_menus;
private:
DISALLOW_COPY_AND_ASSIGN(BubbleContent);
@@ -96,6 +106,8 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
virtual void OnPopupClicked(int index) {}
virtual void OnCustomLinkClicked() {}
virtual void OnManageLinkClicked() {}
+ virtual void OnMediaMenuClicked(content::MediaStreamType type,
+ const std::string& selected_device_id) {}
// Called by the view code when the bubble is closed by the user using the
// Done button.
@@ -132,6 +144,12 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
void set_manage_link(const std::string& link) {
bubble_content_.manage_link = link;
}
+ void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) {
+ bubble_content_.media_menus[type] = menu;
+ }
+ void set_selected_device(const content::MediaStreamDevice& device) {
+ bubble_content_.media_menus[device.type].selected_device = device;
+ }
void AddBlockedResource(const std::string& resource_identifier);
private:
« no previous file with comments | « no previous file | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698