| OLD | NEW |
| 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 "ppapi/c/dev/ppb_file_chooser_dev.h" | 7 #include "ppapi/c/dev/ppb_file_chooser_dev.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
| 10 #include "ppapi/cpp/dev/file_ref_dev.h" | 10 #include "ppapi/cpp/file_ref.h" |
| 11 #include "ppapi/cpp/instance.h" | 11 #include "ppapi/cpp/instance.h" |
| 12 #include "ppapi/cpp/module.h" | 12 #include "ppapi/cpp/module.h" |
| 13 #include "ppapi/cpp/module_impl.h" | 13 #include "ppapi/cpp/module_impl.h" |
| 14 | 14 |
| 15 namespace pp { | 15 namespace pp { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 template <> const char* interface_name<PPB_FileChooser_Dev>() { | 19 template <> const char* interface_name<PPB_FileChooser_Dev>() { |
| 20 return PPB_FILECHOOSER_DEV_INTERFACE; | 20 return PPB_FILECHOOSER_DEV_INTERFACE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 : Resource(other) { | 34 : Resource(other) { |
| 35 } | 35 } |
| 36 | 36 |
| 37 int32_t FileChooser_Dev::Show(const CompletionCallback& cc) { | 37 int32_t FileChooser_Dev::Show(const CompletionCallback& cc) { |
| 38 if (!has_interface<PPB_FileChooser_Dev>()) | 38 if (!has_interface<PPB_FileChooser_Dev>()) |
| 39 return cc.MayForce(PP_ERROR_NOINTERFACE); | 39 return cc.MayForce(PP_ERROR_NOINTERFACE); |
| 40 return get_interface<PPB_FileChooser_Dev>()->Show( | 40 return get_interface<PPB_FileChooser_Dev>()->Show( |
| 41 pp_resource(), cc.pp_completion_callback()); | 41 pp_resource(), cc.pp_completion_callback()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 FileRef_Dev FileChooser_Dev::GetNextChosenFile() const { | 44 FileRef FileChooser_Dev::GetNextChosenFile() const { |
| 45 if (!has_interface<PPB_FileChooser_Dev>()) | 45 if (!has_interface<PPB_FileChooser_Dev>()) |
| 46 return FileRef_Dev(); | 46 return FileRef(); |
| 47 return FileRef_Dev(FileRef_Dev::PassRef(), | 47 return FileRef(FileRef::PassRef(), |
| 48 get_interface<PPB_FileChooser_Dev>()->GetNextChosenFile(pp_resource())); | 48 get_interface<PPB_FileChooser_Dev>()->GetNextChosenFile(pp_resource())); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace pp | 51 } // namespace pp |
| OLD | NEW |