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

Side by Side Diff: chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc

Issue 772983002: Fix a crash on clicking "Load unpacked extension" multiple times (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review. Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 const FileTypeInfo* file_types, 221 const FileTypeInfo* file_types,
222 int file_type_index, 222 int file_type_index,
223 const base::FilePath::StringType& default_extension, 223 const base::FilePath::StringType& default_extension,
224 gfx::NativeWindow owning_window, 224 gfx::NativeWindow owning_window,
225 void* params) { 225 void* params) {
226 type_ = type; 226 type_ = type;
227 // |owning_window| can be null when user right-clicks on a downloadable item 227 // |owning_window| can be null when user right-clicks on a downloadable item
228 // and chooses 'Open Link in New Tab' when 'Ask where to save each file 228 // and chooses 'Open Link in New Tab' when 'Ask where to save each file
229 // before downloading.' preference is turned on. (http://crbug.com/29213) 229 // before downloading.' preference is turned on. (http://crbug.com/29213)
230 if (owning_window) { 230 if (owning_window) {
231 if (IsRunning(owning_window)) {
232 LOG(ERROR) << "Select file dialog already in use!";
233 return;
Devlin 2014/12/04 20:00:14 This isn't what I was referring to. I meant an ea
234 }
231 owning_window->AddObserver(this); 235 owning_window->AddObserver(this);
232 parents_.insert(owning_window); 236 parents_.insert(owning_window);
233 } 237 }
234 238
235 std::string title_string = base::UTF16ToUTF8(title); 239 std::string title_string = base::UTF16ToUTF8(title);
236 240
237 file_type_index_ = file_type_index; 241 file_type_index_ = file_type_index;
238 if (file_types) 242 if (file_types)
239 file_types_ = *file_types; 243 file_types_ = *file_types;
240 244
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 g_free(filename); 631 g_free(filename);
628 if (pixbuf) { 632 if (pixbuf) {
629 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf); 633 gtk_image_set_from_pixbuf(GTK_IMAGE(preview_), pixbuf);
630 g_object_unref(pixbuf); 634 g_object_unref(pixbuf);
631 } 635 }
632 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser), 636 gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(chooser),
633 pixbuf ? TRUE : FALSE); 637 pixbuf ? TRUE : FALSE);
634 } 638 }
635 639
636 } // namespace libgtk2ui 640 } // namespace libgtk2ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698