summaryrefslogtreecommitdiffstats
path: root/ppapi/examples
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 22:21:59 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 22:21:59 +0000
commit11f515acdda3473200ff0cc4106a0020a7d4dc74 (patch)
treecdfd9713928d6f0fa73b5cd7bedbd965fc93e329 /ppapi/examples
parentf60d96e82acd547ac834b93cd68865b66ab5b4da (diff)
downloadchromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.zip
chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.tar.gz
chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.tar.bz2
New file chooser interface that uses the new PP_ArrayOutput feature. This also changes PP_ArrayOutput to be pass-by-value.
This keeps backwards compat for the old interface. It fixes some bugs in the callback system that I found when working on the patch and adds some new machinery for doing array output in the proxy. It also re-enables the file chooser feature which was recently broken. BUG=118857 Review URL: https://chromiumcodereview.appspot.com/9728001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples')
-rw-r--r--ppapi/examples/file_chooser/file_chooser.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/ppapi/examples/file_chooser/file_chooser.cc b/ppapi/examples/file_chooser/file_chooser.cc
index 136ff31..959e649 100644
--- a/ppapi/examples/file_chooser/file_chooser.cc
+++ b/ppapi/examples/file_chooser/file_chooser.cc
@@ -49,19 +49,16 @@ class MyInstance : public pp::InstancePrivate {
std::string accept_mime_types = (multi_select ? "" : "plain/text");
chooser_ = pp::FileChooser_Dev(this, mode, accept_mime_types);
- chooser_.Show(callback_factory_.NewCallback(
+ chooser_.Show(callback_factory_.NewCallbackWithOutput(
&MyInstance::ShowSelectedFileNames));
}
- void ShowSelectedFileNames(int32_t result) {
- if (!result != PP_OK)
+ void ShowSelectedFileNames(int32_t result,
+ const std::vector<pp::FileRef>& files) {
+ if (result != PP_OK)
return;
-
- pp::FileRef file_ref = chooser_.GetNextChosenFile();
- while (!file_ref.is_null()) {
- Log(file_ref.GetName());
- file_ref = chooser_.GetNextChosenFile();
- }
+ for (size_t i = 0; i < files.size(); i++)
+ Log(files[i].GetName());
}
void RecreateConsole() {