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

Side by Side Diff: Source/core/html/forms/FileInputType.cpp

Issue 358923002: Move ENABLE_MEDIA_CAPTURE to a runtime flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 months 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 | « Source/core/html/HTMLInputElement.idl ('k') | Source/platform/FileChooser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return; 150 return;
151 151
152 if (Chrome* chrome = this->chrome()) { 152 if (Chrome* chrome = this->chrome()) {
153 FileChooserSettings settings; 153 FileChooserSettings settings;
154 HTMLInputElement& input = element(); 154 HTMLInputElement& input = element();
155 settings.allowsDirectoryUpload = input.fastHasAttribute(webkitdirectoryA ttr); 155 settings.allowsDirectoryUpload = input.fastHasAttribute(webkitdirectoryA ttr);
156 settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input.f astHasAttribute(multipleAttr); 156 settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input.f astHasAttribute(multipleAttr);
157 settings.acceptMIMETypes = input.acceptMIMETypes(); 157 settings.acceptMIMETypes = input.acceptMIMETypes();
158 settings.acceptFileExtensions = input.acceptFileExtensions(); 158 settings.acceptFileExtensions = input.acceptFileExtensions();
159 settings.selectedFiles = m_fileList->paths(); 159 settings.selectedFiles = m_fileList->paths();
160 #if ENABLE(MEDIA_CAPTURE) 160 settings.useMediaCapture = RuntimeEnabledFeatures::mediaCaptureEnabled() && input.isFileUpload() && input.fastHasAttribute(captureAttr);
161 settings.useMediaCapture = input.isFileUpload() && input.fastHasAttribut e(captureAttr);
162 #endif
163 chrome->runOpenPanel(input.document().frame(), newFileChooser(settings)) ; 161 chrome->runOpenPanel(input.document().frame(), newFileChooser(settings)) ;
164 } 162 }
165 event->setDefaultHandled(); 163 event->setDefaultHandled();
166 } 164 }
167 165
168 RenderObject* FileInputType::createRenderer(RenderStyle*) const 166 RenderObject* FileInputType::createRenderer(RenderStyle*) const
169 { 167 {
170 return new RenderFileUploadControl(&element()); 168 return new RenderFileUploadControl(&element());
171 } 169 }
172 170
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 StringBuilder names; 387 StringBuilder names;
390 for (size_t i = 0; i < listSize; ++i) { 388 for (size_t i = 0; i < listSize; ++i) {
391 names.append(fileList->item(i)->name()); 389 names.append(fileList->item(i)->name());
392 if (i != listSize - 1) 390 if (i != listSize - 1)
393 names.append('\n'); 391 names.append('\n');
394 } 392 }
395 return names.toString(); 393 return names.toString();
396 } 394 }
397 395
398 } // namespace WebCore 396 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLInputElement.idl ('k') | Source/platform/FileChooser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698