pacificIT / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

CEF3: Add dialogs for input type="file" #632

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add dialogs for <input type="file">. This involves implementing 
WebContentsDelegate::RunFileChooser in CefBrowserHostImpl.

Original issue reported on code.google.com by magreenb...@gmail.com on 8 Jun 2012 at 2:55

GoogleCodeExporter commented 9 years ago
So obviously we won't close this bug out until both WIN and MACOSX targets are 
implemented but here's a start. It would be great if we can get at least the 
OSX implementation pushed in.

This is somewhat based off of Chrome, and CEF1.  It has a few more improvements 
above CEF1 in that the file types are honored.  No support for choosing 
folders, or save as just yet.

Original comment by corey.lu...@gmail.com on 9 Jun 2012 at 12:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, Mac support committed as revision 688 with some style-related changes:

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#17
Index: libcef/browser/browser_host_impl_mac.mm

Global functions should be placed near the top of the source file in an 
anonymous namespace.

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#63
+      if (ascii_type[0] == '.')
+        [acceptArray addObject:base::SysUTF8ToNSString(ascii_type)];
+      else { // Otherwise convert mime to UTI

If curly brackets are used for any condition they should be used for all 
conditions in the same if/else block.

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#143
+  NOTIMPLEMENTED();        

Remove whitespace from blank lines and the end of lines.

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#176
+  const int kReadFilePermissions =
+    base::PLATFORM_FILE_OPEN |
+    base::PLATFORM_FILE_READ |
+    base::PLATFORM_FILE_EXCLUSIVE_READ |
+    base::PLATFORM_FILE_ASYNC;

Statement continuations should be indented twice (4 spaces).

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#81

+NSMutableArray* GetFileTypesFromAcceptTypes(const std::vector<string16>& 
accept_types);
+

Don't add blank lines after method definitions.

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#57
+NSMutableArray* GetFileTypesFromAcceptTypes(const std::vector<string16>& 
accept_types) {

Wrap lines at 80 characters.

Original comment by magreenb...@gmail.com on 11 Jun 2012 at 7:49

GoogleCodeExporter commented 9 years ago
2nd to last one should be:

http://code.google.com/p/chromiumembedded/issues/attachmentText?id=632&aid=63200
01000&name=patch.txt&token=fYGCN97UBqRYydJkUGud-EzjcDc%3A1339437605659#81

+void CefBrowserHostImpl::PlatformRunFileChooser(
+    content::WebContents* contents,
+    const content::FileChooserParams& params,
+    std::vector<FilePath>& files) {
+     

Don't add blank lines after method definitions.

Original comment by magreenb...@gmail.com on 11 Jun 2012 at 7:51

GoogleCodeExporter commented 9 years ago
Linux support will be issue #638.

Original comment by magreenb...@gmail.com on 11 Jun 2012 at 7:53

GoogleCodeExporter commented 9 years ago
Windows implementation added in revision 706.

Original comment by magreenb...@gmail.com on 25 Jun 2012 at 3:59