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

Unified Diff: chrome/browser/ui/gtk/content_setting_bubble_gtk.h

Issue 12208010: Adding device selection menus to the content setting bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some more cleanup and ready for review. 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
Index: chrome/browser/ui/gtk/content_setting_bubble_gtk.h
diff --git a/chrome/browser/ui/gtk/content_setting_bubble_gtk.h b/chrome/browser/ui/gtk/content_setting_bubble_gtk.h
index 94a78e86a3737135782e48565f066c86a19a5fc3..6fbd94a524c6ff4c4be2a39da10893ff1b9213b9 100644
--- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.h
+++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.h
@@ -9,11 +9,15 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/content_settings/content_setting_media_menu_model.h"
#include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
+#include "chrome/browser/ui/gtk/menu_gtk.h"
#include "chrome/common/content_settings_types.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/common/media_stream_request.h"
#include "ui/base/gtk/gtk_signal.h"
+#include "ui/base/gtk/owned_widget_gtk.h"
class ContentSettingBubbleModel;
class Profile;
@@ -22,12 +26,18 @@ namespace content {
class WebContents;
}
+namespace ui {
+class SimpleMenuModel;
+}
+
+
// ContentSettingBubbleGtk is used when the user turns on different kinds of
// content blocking (e.g. "block images"). An icon appears in the location bar,
// and when clicked, an instance of this class is created specialized for the
// type of content being blocked.
class ContentSettingBubbleGtk : public BubbleDelegateGtk,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public ContentSettingMediaMenuModel::Observer {
public:
ContentSettingBubbleGtk(
GtkWidget* anchor,
@@ -36,10 +46,30 @@ class ContentSettingBubbleGtk : public BubbleDelegateGtk,
Profile* profile, content::WebContents* web_contents);
virtual ~ContentSettingBubbleGtk();
+ // ContentSettingMediaMenuModel::Observer implementation.
+ virtual void UpdateMenuLabel(content::MediaStreamType type,
+ const std::string& label) OVERRIDE;
+
// Dismisses the bubble.
void Close();
private:
+ // A map from a GtkWidget* to a MediaMenuGtk*. MediaMenuGtk struct is used
markusheintz_ 2013/02/06 11:03:26 See my comment in the views code.
+ // to store the UI members that a media menu owns.
+ struct MediaMenuGtk {
markusheintz_ 2013/02/06 11:03:26 Now I see we you named the equivalent in the views
no longer working on chromium 2013/02/06 13:31:52 Thanks, MediaMenu has been used by the content_set
markusheintz_ 2013/02/06 14:43:19 SGTM
+ MediaMenuGtk();
+ ~MediaMenuGtk();
+
+ content::MediaStreamType type;
+ scoped_ptr<ui::SimpleMenuModel> menu_model;
+ scoped_ptr<MenuGtk> menu;
+ ui::OwnedWidgetGtk label;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaMenuGtk);
+ };
+ typedef std::map<GtkWidget*, MediaMenuGtk*> GtkMediaMenuMap;
+
typedef std::map<GtkWidget*, int> PopupMap;
// BubbleDelegateGtk:
@@ -61,6 +91,7 @@ class ContentSettingBubbleGtk : public BubbleDelegateGtk,
CHROMEGTK_CALLBACK_0(ContentSettingBubbleGtk, void, OnCustomLinkClicked);
CHROMEGTK_CALLBACK_0(ContentSettingBubbleGtk, void, OnManageLinkClicked);
CHROMEGTK_CALLBACK_0(ContentSettingBubbleGtk, void, OnCloseButtonClicked);
+ CHROMEGTK_CALLBACK_0(ContentSettingBubbleGtk, void, OnMenuButtonClicked);
// We position the bubble near this widget.
GtkWidget* anchor_;
@@ -89,6 +120,8 @@ class ContentSettingBubbleGtk : public BubbleDelegateGtk,
typedef std::vector<GtkWidget*> RadioGroupGtk;
RadioGroupGtk radio_group_gtk_;
+
+ GtkMediaMenuMap media_menus_;
};
#endif // CHROME_BROWSER_UI_GTK_CONTENT_SETTING_BUBBLE_GTK_H_

Powered by Google App Engine
This is Rietveld 408576698