| OLD | NEW |
| 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/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 gtk_widget_set_tooltip_text(widget, UTF16ToUTF8( | 110 gtk_widget_set_tooltip_text(widget, UTF16ToUTF8( |
| 111 MediaGalleriesDialogController::GetGalleryTooltip(*gallery)).c_str()); | 111 MediaGalleriesDialogController::GetGalleryTooltip(*gallery)).c_str()); |
| 112 | 112 |
| 113 base::AutoReset<bool> reset(&ignore_toggles_, true); | 113 base::AutoReset<bool> reset(&ignore_toggles_, true); |
| 114 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), permitted); | 114 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), permitted); |
| 115 std::string label_text = UTF16ToUTF8( | 115 std::string label_text = UTF16ToUTF8( |
| 116 MediaGalleriesDialogController::GetGalleryDisplayName(*gallery)); | 116 MediaGalleriesDialogController::GetGalleryDisplayName(*gallery)); |
| 117 gtk_button_set_label(GTK_BUTTON(widget), label_text.c_str()); | 117 gtk_button_set_label(GTK_BUTTON(widget), label_text.c_str()); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void MediaGalleriesDialogGtk::ForgetGallery( |
| 121 const MediaGalleryPrefInfo* gallery) { |
| 122 CheckboxMap::iterator iter = checkbox_map_.find(gallery); |
| 123 if (iter == checkbox_map_.end()) |
| 124 return; |
| 125 |
| 126 base::AutoReset<bool> reset(&ignore_toggles_, true); |
| 127 gtk_widget_destroy(iter->second); |
| 128 checkbox_map_.erase(iter); |
| 129 } |
| 130 |
| 120 GtkWidget* MediaGalleriesDialogGtk::GetWidgetRoot() { | 131 GtkWidget* MediaGalleriesDialogGtk::GetWidgetRoot() { |
| 121 return contents_.get(); | 132 return contents_.get(); |
| 122 } | 133 } |
| 123 | 134 |
| 124 GtkWidget* MediaGalleriesDialogGtk::GetFocusWidget() { | 135 GtkWidget* MediaGalleriesDialogGtk::GetFocusWidget() { |
| 125 return confirm_; | 136 return confirm_; |
| 126 } | 137 } |
| 127 | 138 |
| 128 void MediaGalleriesDialogGtk::DeleteDelegate() { | 139 void MediaGalleriesDialogGtk::DeleteDelegate() { |
| 129 controller_->DialogFinished(accepted_); | 140 controller_->DialogFinished(accepted_); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 175 |
| 165 // MediaGalleriesDialogController ---------------------------------------------- | 176 // MediaGalleriesDialogController ---------------------------------------------- |
| 166 | 177 |
| 167 // static | 178 // static |
| 168 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 179 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 169 MediaGalleriesDialogController* controller) { | 180 MediaGalleriesDialogController* controller) { |
| 170 return new MediaGalleriesDialogGtk(controller); | 181 return new MediaGalleriesDialogGtk(controller); |
| 171 } | 182 } |
| 172 | 183 |
| 173 } // namespace chrome | 184 } // namespace chrome |
| OLD | NEW |