| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 const FileChooserSettings& settings) { | 56 const FileChooserSettings& settings) { |
| 57 return adoptRef(new FileChooser(client, settings)); | 57 return adoptRef(new FileChooser(client, settings)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 FileChooser::~FileChooser() {} | 60 FileChooser::~FileChooser() {} |
| 61 | 61 |
| 62 void FileChooser::chooseFiles(const Vector<FileChooserFileInfo>& files) { | 62 void FileChooser::chooseFiles(const Vector<FileChooserFileInfo>& files) { |
| 63 // FIXME: This is inelegant. We should not be looking at settings here. | 63 // FIXME: This is inelegant. We should not be looking at settings here. |
| 64 Vector<String> paths; | 64 Vector<String> paths; |
| 65 for (unsigned i = 0; i < files.size(); ++i) | 65 for (unsigned i = 0; i < files.size(); ++i) |
| 66 paths.append(files[i].path); | 66 paths.push_back(files[i].path); |
| 67 if (m_settings.selectedFiles == paths) | 67 if (m_settings.selectedFiles == paths) |
| 68 return; | 68 return; |
| 69 | 69 |
| 70 if (m_client) | 70 if (m_client) |
| 71 m_client->filesChosen(files); | 71 m_client->filesChosen(files); |
| 72 } | 72 } |
| 73 | 73 |
| 74 Vector<String> FileChooserSettings::acceptTypes() const { | 74 Vector<String> FileChooserSettings::acceptTypes() const { |
| 75 Vector<String> acceptTypes; | 75 Vector<String> acceptTypes; |
| 76 acceptTypes.reserveCapacity(acceptMIMETypes.size() + | 76 acceptTypes.reserveCapacity(acceptMIMETypes.size() + |
| 77 acceptFileExtensions.size()); | 77 acceptFileExtensions.size()); |
| 78 acceptTypes.appendVector(acceptMIMETypes); | 78 acceptTypes.appendVector(acceptMIMETypes); |
| 79 acceptTypes.appendVector(acceptFileExtensions); | 79 acceptTypes.appendVector(acceptFileExtensions); |
| 80 return acceptTypes; | 80 return acceptTypes; |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |