| OLD | NEW |
| 1 // Copyright (c) 2010 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/dev/file_ref_dev.h" |
| 11 #include "ppapi/cpp/instance.h" | 11 #include "ppapi/cpp/instance.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 29 PassRefFromConstructor(get_interface<PPB_FileChooser_Dev>()->Create( | 29 PassRefFromConstructor(get_interface<PPB_FileChooser_Dev>()->Create( |
| 30 instance.pp_instance(), &options)); | 30 instance.pp_instance(), &options)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 FileChooser_Dev::FileChooser_Dev(const FileChooser_Dev& other) | 33 FileChooser_Dev::FileChooser_Dev(const FileChooser_Dev& other) |
| 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 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_Dev 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_Dev(); |
| 47 return FileRef_Dev(FileRef_Dev::PassRef(), | 47 return FileRef_Dev(FileRef_Dev::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 |