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

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

Issue 12457016: Added "None available" title and grey out the media menu when there is no device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. Created 7 years, 9 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 | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/views/content_setting_bubble_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/content_setting_bubble_gtk.cc
diff --git a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc
index bc0593df125010cd3933ea25956a8a456c035bc6..7212fed970e4394299d6c26f05bcde0e35ce7d52 100644
--- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc
@@ -257,6 +257,15 @@ void ContentSettingBubbleGtk::BuildBubble() {
gtk_menu->menu.reset(new MenuGtk(NULL, gtk_menu->menu_model.get()));
media_menus_[button] = gtk_menu;
+ if (!gtk_menu->menu_model->GetItemCount()) {
+ // Show a "None available" title and grey out the menu when there is no
+ // available device.
+ UpdateMenuLabel(
+ gtk_menu->type,
+ l10n_util::GetStringUTF8(IDS_MEDIA_MENU_NO_DEVICE_TITLE));
+ gtk_widget_set_sensitive(button, FALSE);
+ }
+
// Use the longest width of the menus as the width of the menu buttons.
GtkRequisition menu_req;
gtk_widget_size_request(gtk_menu->menu->widget(), &menu_req);
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/views/content_setting_bubble_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698