Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 704 notifyPopupOpeningObservers(); | 704 notifyPopupOpeningObservers(); |
| 705 WebFrameClient* client = WebLocalFrameImpl::fromFrame(frame)->client(); | 705 WebFrameClient* client = WebLocalFrameImpl::fromFrame(frame)->client(); |
| 706 if (!client) | 706 if (!client) |
| 707 return; | 707 return; |
| 708 | 708 |
| 709 WebFileChooserParams params; | 709 WebFileChooserParams params; |
| 710 params.multiSelect = fileChooser->settings().allowsMultipleFiles; | 710 params.multiSelect = fileChooser->settings().allowsMultipleFiles; |
| 711 params.directory = fileChooser->settings().allowsDirectoryUpload; | 711 params.directory = fileChooser->settings().allowsDirectoryUpload; |
| 712 params.acceptTypes = fileChooser->settings().acceptTypes(); | 712 params.acceptTypes = fileChooser->settings().acceptTypes(); |
| 713 params.selectedFiles = fileChooser->settings().selectedFiles; | 713 params.selectedFiles = fileChooser->settings().selectedFiles; |
| 714 if (params.selectedFiles.size() > 0) | |
| 715 params.initialValue = params.selectedFiles[0]; | |
|
dcheng
2016/10/25 00:27:35
Is it possible to remove initialValue completely?
jsbell
2016/10/25 16:24:55
Used in PepperFileChooserHost::OnShow apparently,
| |
| 716 params.useMediaCapture = fileChooser->settings().useMediaCapture; | 714 params.useMediaCapture = fileChooser->settings().useMediaCapture; |
| 717 params.needLocalPath = fileChooser->settings().allowsDirectoryUpload; | 715 params.needLocalPath = fileChooser->settings().allowsDirectoryUpload; |
| 718 params.requestor = frame->document()->url(); | 716 params.requestor = frame->document()->url(); |
| 719 | 717 |
| 720 WebFileChooserCompletionImpl* chooserCompletion = | 718 WebFileChooserCompletionImpl* chooserCompletion = |
| 721 new WebFileChooserCompletionImpl(std::move(fileChooser)); | 719 new WebFileChooserCompletionImpl(std::move(fileChooser)); |
| 722 if (client->runFileChooser(params, chooserCompletion)) | 720 if (client->runFileChooser(params, chooserCompletion)) |
| 723 return; | 721 return; |
| 724 // Choosing failed, so do callback with an empty list. | 722 // Choosing failed, so do callback with an empty list. |
| 725 chooserCompletion->didChooseFile(WebVector<WebString>()); | 723 chooserCompletion->didChooseFile(WebVector<WebString>()); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1161 if (RuntimeEnabledFeatures::presentationEnabled()) | 1159 if (RuntimeEnabledFeatures::presentationEnabled()) |
| 1162 PresentationController::provideTo(frame, client->presentationClient()); | 1160 PresentationController::provideTo(frame, client->presentationClient()); |
| 1163 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) | 1161 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) |
| 1164 provideAudioOutputDeviceClientTo(frame, | 1162 provideAudioOutputDeviceClientTo(frame, |
| 1165 AudioOutputDeviceClientImpl::create()); | 1163 AudioOutputDeviceClientImpl::create()); |
| 1166 if (RuntimeEnabledFeatures::installedAppEnabled()) | 1164 if (RuntimeEnabledFeatures::installedAppEnabled()) |
| 1167 InstalledAppController::provideTo(frame, client->installedAppClient()); | 1165 InstalledAppController::provideTo(frame, client->installedAppClient()); |
| 1168 } | 1166 } |
| 1169 | 1167 |
| 1170 } // namespace blink | 1168 } // namespace blink |
| OLD | NEW |