| 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 "ui/shell_dialogs/select_file_dialog_mac.h" | 5 #include "ui/shell_dialogs/select_file_dialog_mac.h" |
| 6 | 6 |
| 7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 type:type | 241 type:type |
| 242 parentWindow:owning_window]; | 242 parentWindow:owning_window]; |
| 243 }]; | 243 }]; |
| 244 } | 244 } |
| 245 | 245 |
| 246 SelectFileDialogImpl::DialogData::DialogData( | 246 SelectFileDialogImpl::DialogData::DialogData( |
| 247 void* params_, | 247 void* params_, |
| 248 base::scoped_nsobject<ExtensionDropdownHandler> handler) | 248 base::scoped_nsobject<ExtensionDropdownHandler> handler) |
| 249 : params(params_), extension_dropdown_handler(handler) {} | 249 : params(params_), extension_dropdown_handler(handler) {} |
| 250 | 250 |
| 251 SelectFileDialogImpl::DialogData::DialogData(const DialogData& other) = default; |
| 252 |
| 251 SelectFileDialogImpl::DialogData::~DialogData() {} | 253 SelectFileDialogImpl::DialogData::~DialogData() {} |
| 252 | 254 |
| 253 SelectFileDialogImpl::~SelectFileDialogImpl() { | 255 SelectFileDialogImpl::~SelectFileDialogImpl() { |
| 254 // Walk through the open dialogs and close them all. Use a temporary vector | 256 // Walk through the open dialogs and close them all. Use a temporary vector |
| 255 // to hold the pointers, since we can't delete from the map as we're iterating | 257 // to hold the pointers, since we can't delete from the map as we're iterating |
| 256 // through it. | 258 // through it. |
| 257 std::vector<NSSavePanel*> panels; | 259 std::vector<NSSavePanel*> panels; |
| 258 for (const auto& value : dialog_data_map_) | 260 for (const auto& value : dialog_data_map_) |
| 259 panels.push_back(value.first); | 261 panels.push_back(value.first); |
| 260 | 262 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // For save dialogs, this causes the first item in the allowedFileTypes | 442 // For save dialogs, this causes the first item in the allowedFileTypes |
| 441 // array to be used as the extension for the save panel. | 443 // array to be used as the extension for the save panel. |
| 442 [dialog_ setAllowedFileTypes:[fileTypeLists_ objectAtIndex:index]]; | 444 [dialog_ setAllowedFileTypes:[fileTypeLists_ objectAtIndex:index]]; |
| 443 } else { | 445 } else { |
| 444 // The user selected "All files" option. | 446 // The user selected "All files" option. |
| 445 [dialog_ setAllowedFileTypes:nil]; | 447 [dialog_ setAllowedFileTypes:nil]; |
| 446 } | 448 } |
| 447 } | 449 } |
| 448 | 450 |
| 449 @end | 451 @end |
| OLD | NEW |