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

Unified Diff: ppapi/examples/file_chooser/file_chooser.cc

Issue 9728001: Make the file chooser use PP_ArrayOutput (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/examples/file_chooser/file_chooser.cc
diff --git a/ppapi/examples/file_chooser/file_chooser.cc b/ppapi/examples/file_chooser/file_chooser.cc
index 136ff31fb54beb7ae84cb19a2d3e1d1c84da070d..959e649f16fc2f95347f9bc65d4ff8f416e4d0a3 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() {

Powered by Google App Engine
This is Rietveld 408576698