| 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 // Xlib defines RootWindow | 10 // Xlib defines RootWindow |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return new SelectFileDialogImplGTK(listener, policy); | 173 return new SelectFileDialogImplGTK(listener, policy); |
| 174 } | 174 } |
| 175 | 175 |
| 176 SelectFileDialogImplGTK::SelectFileDialogImplGTK(Listener* listener, | 176 SelectFileDialogImplGTK::SelectFileDialogImplGTK(Listener* listener, |
| 177 ui::SelectFilePolicy* policy) | 177 ui::SelectFilePolicy* policy) |
| 178 : SelectFileDialogImpl(listener, policy), | 178 : SelectFileDialogImpl(listener, policy), |
| 179 preview_(NULL) { | 179 preview_(NULL) { |
| 180 } | 180 } |
| 181 | 181 |
| 182 SelectFileDialogImplGTK::~SelectFileDialogImplGTK() { | 182 SelectFileDialogImplGTK::~SelectFileDialogImplGTK() { |
| 183 for (std::set<aura::Window*>::iterator iter = parents_.begin(); |
| 184 iter != parents_.end(); ++iter) { |
| 185 (*iter)->RemoveObserver(this); |
| 186 } |
| 183 while (dialogs_.begin() != dialogs_.end()) { | 187 while (dialogs_.begin() != dialogs_.end()) { |
| 184 gtk_widget_destroy(*(dialogs_.begin())); | 188 gtk_widget_destroy(*(dialogs_.begin())); |
| 185 } | 189 } |
| 186 } | 190 } |
| 187 | 191 |
| 188 bool SelectFileDialogImplGTK::IsRunning(gfx::NativeWindow parent_window) const { | 192 bool SelectFileDialogImplGTK::IsRunning(gfx::NativeWindow parent_window) const { |
| 189 return parents_.find(parent_window) != parents_.end(); | 193 return parents_.find(parent_window) != parents_.end(); |
| 190 } | 194 } |
| 191 | 195 |
| 192 bool SelectFileDialogImplGTK::HasMultipleFileTypeChoicesImpl() { | 196 bool SelectFileDialogImplGTK::HasMultipleFileTypeChoicesImpl() { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 g_free(filename); | 622 g_free(filename); |
| 619 if (pixbuf) { | 623 if (pixbuf) { |
| 620 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); | 624 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); |
| 621 g_object_unref(pixbuf); | 625 g_object_unref(pixbuf); |
| 622 } | 626 } |
| 623 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), | 627 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), |
| 624 pixbuf ? TRUE : FALSE); | 628 pixbuf ? TRUE : FALSE); |
| 625 } | 629 } |
| 626 | 630 |
| 627 } // namespace libgtk2ui | 631 } // namespace libgtk2ui |
| OLD | NEW |