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

Unified Diff: chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc

Issue 10834242: Cocoa: Implement media gallery dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac build Created 8 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/ui/gtk/extensions/media_galleries_dialog_gtk.cc
diff --git a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc
index 16fbec63a6b0f3a17daeda5022787bce7c689cdb..9ee7fb52d3756ac58441d84a5bd64d891f2480fe 100644
--- a/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc
@@ -52,14 +52,9 @@ void MediaGalleriesDialogGtk::InitWidgets() {
gtk_box_pack_start(GTK_BOX(contents_.get()), checkbox_container_,
FALSE, FALSE, 0);
- // As a safeguard against the user skipping reading over the dialog and just
- // confirming, the button will be unavailable for dialogs without any checks
- // until the user toggles something.
- bool confirm_available = false;
const GalleryPermissions& permissions = controller_->permissions();
for (GalleryPermissions::const_iterator iter = permissions.begin();
iter != permissions.end(); iter++) {
- confirm_available = confirm_available || iter->second.allowed;
UpdateGallery(&iter->second.pref_info, iter->second.allowed);
}
@@ -90,7 +85,10 @@ void MediaGalleriesDialogGtk::InitWidgets() {
g_signal_connect(cancel, "clicked", G_CALLBACK(OnCancelThunk), this);
gtk_box_pack_end(GTK_BOX(bottom_area), cancel, FALSE, FALSE, 0);
- gtk_widget_set_sensitive(confirm_, confirm_available);
+ // As a safeguard against the user skipping reading over the dialog and just
+ // confirming, the button will be unavailable for dialogs without any checks
+ // until the user toggles something.
+ gtk_widget_set_sensitive(confirm_, controller_->HasPermittedGalleries());
}
void MediaGalleriesDialogGtk::UpdateGallery(
@@ -136,7 +134,7 @@ void MediaGalleriesDialogGtk::OnToggled(GtkWidget* widget) {
for (CheckboxMap::iterator iter = checkbox_map_.begin();
iter != checkbox_map_.end(); ++iter) {
if (iter->second == widget) {
- controller_->GalleryToggled(
+ controller_->DidToggleGallery(
iter->first, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
return;
}

Powered by Google App Engine
This is Rietveld 408576698