| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return; | 26 return; |
| 27 PassRefFromConstructor(file_chooser_f->Create(instance.pp_instance(), | 27 PassRefFromConstructor(file_chooser_f->Create(instance.pp_instance(), |
| 28 &options)); | 28 &options)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 FileChooser_Dev::FileChooser_Dev(const FileChooser_Dev& other) | 31 FileChooser_Dev::FileChooser_Dev(const FileChooser_Dev& other) |
| 32 : Resource(other) { | 32 : Resource(other) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 FileChooser_Dev& FileChooser_Dev::operator=(const FileChooser_Dev& other) { | 35 FileChooser_Dev& FileChooser_Dev::operator=(const FileChooser_Dev& other) { |
| 36 FileChooser_Dev copy(other); | 36 Resource::operator=(other); |
| 37 swap(copy); | |
| 38 return *this; | 37 return *this; |
| 39 } | 38 } |
| 40 | 39 |
| 41 void FileChooser_Dev::swap(FileChooser_Dev& other) { | |
| 42 Resource::swap(other); | |
| 43 } | |
| 44 | 40 |
| 45 int32_t FileChooser_Dev::Show(const CompletionCallback& cc) { | 41 int32_t FileChooser_Dev::Show(const CompletionCallback& cc) { |
| 46 if (!file_chooser_f) | 42 if (!file_chooser_f) |
| 47 return PP_ERROR_NOINTERFACE; | 43 return PP_ERROR_NOINTERFACE; |
| 48 return file_chooser_f->Show(pp_resource(), cc.pp_completion_callback()); | 44 return file_chooser_f->Show(pp_resource(), cc.pp_completion_callback()); |
| 49 } | 45 } |
| 50 | 46 |
| 51 FileRef_Dev FileChooser_Dev::GetNextChosenFile() const { | 47 FileRef_Dev FileChooser_Dev::GetNextChosenFile() const { |
| 52 if (!file_chooser_f) | 48 if (!file_chooser_f) |
| 53 return FileRef_Dev(); | 49 return FileRef_Dev(); |
| 54 return FileRef_Dev(FileRef_Dev::PassRef(), | 50 return FileRef_Dev(FileRef_Dev::PassRef(), |
| 55 file_chooser_f->GetNextChosenFile(pp_resource())); | 51 file_chooser_f->GetNextChosenFile(pp_resource())); |
| 56 } | 52 } |
| 57 | 53 |
| 58 } // namespace pp | 54 } // namespace pp |
| OLD | NEW |