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

Side by Side Diff: chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc

Issue 10832330: disable [add folder] button for media galleries dialog if (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h" 5 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/media_gallery/media_galleries_preferences.h" 9 #include "chrome/browser/media_gallery/media_galleries_preferences.h"
10 #include "chrome/browser/ui/chrome_select_file_policy.h"
10 #include "chrome/browser/ui/gtk/gtk_util.h" 11 #include "chrome/browser/ui/gtk/gtk_util.h"
11 #include "grit/generated_resources.h" 12 #include "grit/generated_resources.h"
12 #include "ui/base/gtk/gtk_hig_constants.h" 13 #include "ui/base/gtk/gtk_hig_constants.h"
13 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
14 15
15 namespace chrome { 16 namespace chrome {
16 17
17 typedef MediaGalleriesDialogController::KnownGalleryPermissions 18 typedef MediaGalleriesDialogController::KnownGalleryPermissions
18 GalleryPermissions; 19 GalleryPermissions;
19 20
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 iter != permissions.end(); iter++) { 62 iter != permissions.end(); iter++) {
62 confirm_available = confirm_available || iter->second.allowed; 63 confirm_available = confirm_available || iter->second.allowed;
63 UpdateGallery(&iter->second.pref_info, iter->second.allowed); 64 UpdateGallery(&iter->second.pref_info, iter->second.allowed);
64 } 65 }
65 66
66 // Holds the "add gallery" and cancel/confirm buttons. 67 // Holds the "add gallery" and cancel/confirm buttons.
67 GtkWidget* bottom_area = gtk_hbox_new(FALSE, ui::kControlSpacing); 68 GtkWidget* bottom_area = gtk_hbox_new(FALSE, ui::kControlSpacing);
68 gtk_box_pack_start(GTK_BOX(contents_.get()), bottom_area, FALSE, FALSE, 0); 69 gtk_box_pack_start(GTK_BOX(contents_.get()), bottom_area, FALSE, FALSE, 0);
69 70
70 // Add gallery button. 71 // Add gallery button.
71 GtkWidget* add_folder = gtk_button_new_with_label( 72 if (ChromeSelectFilePolicy::FileSelectDialogsAllowed()) {
72 l10n_util::GetStringUTF8(IDS_MEDIA_GALLERIES_DIALOG_ADD_GALLERY).c_str()); 73 GtkWidget* add_folder = gtk_button_new_with_label(l10n_util::GetStringUTF8(
73 g_signal_connect(add_folder, "clicked", G_CALLBACK(OnAddFolderThunk), this); 74 IDS_MEDIA_GALLERIES_DIALOG_ADD_GALLERY).c_str());
74 gtk_box_pack_start(GTK_BOX(bottom_area), add_folder, FALSE, FALSE, 0); 75 g_signal_connect(add_folder, "clicked", G_CALLBACK(OnAddFolderThunk), this);
76 gtk_box_pack_start(GTK_BOX(bottom_area), add_folder, FALSE, FALSE, 0);
77 }
75 78
76 // Confirm/cancel button. 79 // Confirm/cancel button.
77 confirm_ = gtk_button_new_with_label(l10n_util::GetStringUTF8( 80 confirm_ = gtk_button_new_with_label(l10n_util::GetStringUTF8(
78 IDS_MEDIA_GALLERIES_DIALOG_CONFIRM).c_str()); 81 IDS_MEDIA_GALLERIES_DIALOG_CONFIRM).c_str());
79 gtk_button_set_image( 82 gtk_button_set_image(
80 GTK_BUTTON(confirm_), 83 GTK_BUTTON(confirm_),
81 gtk_image_new_from_stock(GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON)); 84 gtk_image_new_from_stock(GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON));
82 g_signal_connect(confirm_, "clicked", G_CALLBACK(OnConfirmThunk), this); 85 g_signal_connect(confirm_, "clicked", G_CALLBACK(OnConfirmThunk), this);
83 gtk_box_pack_end(GTK_BOX(bottom_area), confirm_, FALSE, FALSE, 0); 86 gtk_box_pack_end(GTK_BOX(bottom_area), confirm_, FALSE, FALSE, 0);
84 87
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 164
162 // MediaGalleriesDialogController ---------------------------------------------- 165 // MediaGalleriesDialogController ----------------------------------------------
163 166
164 // static 167 // static
165 MediaGalleriesDialog* MediaGalleriesDialog::Create( 168 MediaGalleriesDialog* MediaGalleriesDialog::Create(
166 MediaGalleriesDialogController* controller) { 169 MediaGalleriesDialogController* controller) {
167 return new MediaGalleriesDialogGtk(controller); 170 return new MediaGalleriesDialogGtk(controller);
168 } 171 }
169 172
170 } // namespace chrome 173 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698