Chromium Code Reviews| 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 if (checkbox_map_.empty()) | |
| 130 gtk_widget_set_sensitive(confirm_, FALSE); | |
|
Evan Stade
2013/02/13 00:18:51
why the behavior difference between views and gtk
Lei Zhang
2013/02/13 01:51:07
Ok, I will remove it, probably tomorrow.
Lei Zhang
2013/02/13 22:38:38
Done.
| |
| 131 } | |
| 132 | |
| 120 GtkWidget* MediaGalleriesDialogGtk::GetWidgetRoot() { | 133 GtkWidget* MediaGalleriesDialogGtk::GetWidgetRoot() { |
| 121 return contents_.get(); | 134 return contents_.get(); |
| 122 } | 135 } |
| 123 | 136 |
| 124 GtkWidget* MediaGalleriesDialogGtk::GetFocusWidget() { | 137 GtkWidget* MediaGalleriesDialogGtk::GetFocusWidget() { |
| 125 return confirm_; | 138 return confirm_; |
| 126 } | 139 } |
| 127 | 140 |
| 128 void MediaGalleriesDialogGtk::DeleteDelegate() { | 141 void MediaGalleriesDialogGtk::DeleteDelegate() { |
| 129 controller_->DialogFinished(accepted_); | 142 controller_->DialogFinished(accepted_); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 | 177 |
| 165 // MediaGalleriesDialogController ---------------------------------------------- | 178 // MediaGalleriesDialogController ---------------------------------------------- |
| 166 | 179 |
| 167 // static | 180 // static |
| 168 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 181 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 169 MediaGalleriesDialogController* controller) { | 182 MediaGalleriesDialogController* controller) { |
| 170 return new MediaGalleriesDialogGtk(controller); | 183 return new MediaGalleriesDialogGtk(controller); |
| 171 } | 184 } |
| 172 | 185 |
| 173 } // namespace chrome | 186 } // namespace chrome |
| OLD | NEW |