OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef PPAPI_CPP_DEV_FILE_CHOOSER_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_FILE_CHOOSER_DEV_H_ |
6 #define PPAPI_CPP_DEV_FILE_CHOOSER_DEV_H_ | 6 #define PPAPI_CPP_DEV_FILE_CHOOSER_DEV_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ppapi/c/dev/ppb_file_chooser_dev.h" | 10 #include "ppapi/c/dev/ppb_file_chooser_dev.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const CompletionCallbackWithOutput< std::vector<FileRef> >& callback); | 79 const CompletionCallbackWithOutput< std::vector<FileRef> >& callback); |
80 | 80 |
81 protected: | 81 protected: |
82 // Heap-allocated data passed to the CallbackConverter for backwards compat. | 82 // Heap-allocated data passed to the CallbackConverter for backwards compat. |
83 struct ChooseCallbackData0_5 { | 83 struct ChooseCallbackData0_5 { |
84 PP_Resource file_chooser; | 84 PP_Resource file_chooser; |
85 PP_ArrayOutput output; | 85 PP_ArrayOutput output; |
86 PP_CompletionCallback original_callback; | 86 PP_CompletionCallback original_callback; |
87 }; | 87 }; |
88 | 88 |
89 // Provide backwards-compatability for older versions. Converts the old-style | 89 // Provide backwards-compatibility for older versions. Converts the old-style |
90 // 0.5 "iterator" interface to the new-style 0.6 "array output" interface that | 90 // 0.5 "iterator" interface to the new-style 0.6 "array output" interface that |
91 // the caller is expecting. | 91 // the caller is expecting. |
92 // | 92 // |
93 // This takes a heap-allocated ChooseCallbackData0_5 struct passed as the | 93 // This takes a heap-allocated ChooseCallbackData0_5 struct passed as the |
94 // user data and deletes it when the call completes. | 94 // user data and deletes it when the call completes. |
95 static void CallbackConverter(void* user_data, int32_t result); | 95 static void CallbackConverter(void* user_data, int32_t result); |
96 }; | 96 }; |
97 | 97 |
98 } // namespace pp | 98 } // namespace pp |
99 | 99 |
100 #endif // PPAPI_CPP_DEV_FILE_CHOOSER_DEV_H_ | 100 #endif // PPAPI_CPP_DEV_FILE_CHOOSER_DEV_H_ |
OLD | NEW |