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

Side by Side Diff: ppapi/cpp/dev/file_chooser_dev.cc

Issue 10414085: Modified the pepper file chooser API to support filtering files by extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/cpp/dev/file_chooser_dev.h ('k') | ppapi/cpp/trusted/file_chooser_trusted.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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/cpp/dev/file_chooser_dev.h" 5 #include "ppapi/cpp/dev/file_chooser_dev.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "ppapi/c/dev/ppb_file_chooser_dev.h" 9 #include "ppapi/c/dev/ppb_file_chooser_dev.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 template <> const char* interface_name<PPB_FileChooser_Dev_0_6>() { 25 template <> const char* interface_name<PPB_FileChooser_Dev_0_6>() {
26 return PPB_FILECHOOSER_DEV_INTERFACE_0_6; 26 return PPB_FILECHOOSER_DEV_INTERFACE_0_6;
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 30
31 FileChooser_Dev::FileChooser_Dev(const InstanceHandle& instance, 31 FileChooser_Dev::FileChooser_Dev(const InstanceHandle& instance,
32 PP_FileChooserMode_Dev mode, 32 PP_FileChooserMode_Dev mode,
33 const Var& accept_mime_types) { 33 const Var& accept_types) {
34 if (has_interface<PPB_FileChooser_Dev_0_6>()) { 34 if (has_interface<PPB_FileChooser_Dev_0_6>()) {
35 PassRefFromConstructor(get_interface<PPB_FileChooser_Dev_0_6>()->Create( 35 PassRefFromConstructor(get_interface<PPB_FileChooser_Dev_0_6>()->Create(
36 instance.pp_instance(), mode, accept_mime_types.pp_var())); 36 instance.pp_instance(), mode, accept_types.pp_var()));
37 } else if (has_interface<PPB_FileChooser_Dev_0_5>()) { 37 } else if (has_interface<PPB_FileChooser_Dev_0_5>()) {
38 PassRefFromConstructor(get_interface<PPB_FileChooser_Dev_0_5>()->Create( 38 PassRefFromConstructor(get_interface<PPB_FileChooser_Dev_0_5>()->Create(
39 instance.pp_instance(), mode, accept_mime_types.pp_var())); 39 instance.pp_instance(), mode, accept_types.pp_var()));
40 } 40 }
41 } 41 }
42 42
43 FileChooser_Dev::FileChooser_Dev(const FileChooser_Dev& other) 43 FileChooser_Dev::FileChooser_Dev(const FileChooser_Dev& other)
44 : Resource(other) { 44 : Resource(other) {
45 } 45 }
46 46
47 int32_t FileChooser_Dev::Show( 47 int32_t FileChooser_Dev::Show(
48 const CompletionCallbackWithOutput< std::vector<FileRef> >& callback) { 48 const CompletionCallbackWithOutput< std::vector<FileRef> >& callback) {
49 if (has_interface<PPB_FileChooser_Dev_0_6>()) { 49 if (has_interface<PPB_FileChooser_Dev_0_6>()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 for (size_t i = 0; i < selected_files.size(); i++) 93 for (size_t i = 0; i < selected_files.size(); i++)
94 Module::Get()->core()->ReleaseResource(selected_files[i]); 94 Module::Get()->core()->ReleaseResource(selected_files[i]);
95 } 95 }
96 96
97 // Now execute the original callback. 97 // Now execute the original callback.
98 PP_RunCompletionCallback(&data->original_callback, result); 98 PP_RunCompletionCallback(&data->original_callback, result);
99 delete data; 99 delete data;
100 } 100 }
101 101
102 } // namespace pp 102 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/file_chooser_dev.h ('k') | ppapi/cpp/trusted/file_chooser_trusted.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698