| 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 "webkit/glue/plugins/pepper_file_chooser.h" | 5 #include "webkit/glue/plugins/pepper_file_chooser.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/ppapi/c/pp_completion_callback.h" | 8 #include "third_party/ppapi/c/pp_completion_callback.h" |
| 9 #include "third_party/ppapi/c/pp_errors.h" | 9 #include "third_party/ppapi/c/pp_errors.h" |
| 10 #include "webkit/glue/plugins/pepper_file_ref.h" | 10 #include "webkit/glue/plugins/pepper_file_ref.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 bool IsFileChooser(PP_Resource resource) { | 29 bool IsFileChooser(PP_Resource resource) { |
| 30 return !!Resource::GetAs<FileChooser>(resource).get(); | 30 return !!Resource::GetAs<FileChooser>(resource).get(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 int32_t Show(PP_Resource chooser_id, PP_CompletionCallback callback) { | 33 int32_t Show(PP_Resource chooser_id, PP_CompletionCallback callback) { |
| 34 scoped_refptr<FileChooser> chooser( | 34 scoped_refptr<FileChooser> chooser( |
| 35 Resource::GetAs<FileChooser>(chooser_id).get()); | 35 Resource::GetAs<FileChooser>(chooser_id).get()); |
| 36 if (!chooser.get()) | 36 if (!chooser.get()) |
| 37 return PP_Error_BadResource; | 37 return PP_ERROR_BADRESOURCE; |
| 38 | 38 |
| 39 return chooser->Show(callback); | 39 return chooser->Show(callback); |
| 40 } | 40 } |
| 41 | 41 |
| 42 PP_Resource GetNextChosenFile(PP_Resource chooser_id) { | 42 PP_Resource GetNextChosenFile(PP_Resource chooser_id) { |
| 43 scoped_refptr<FileChooser> chooser( | 43 scoped_refptr<FileChooser> chooser( |
| 44 Resource::GetAs<FileChooser>(chooser_id).get()); | 44 Resource::GetAs<FileChooser>(chooser_id).get()); |
| 45 if (!chooser.get()) | 45 if (!chooser.get()) |
| 46 return 0; | 46 return 0; |
| 47 | 47 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 FileChooser::~FileChooser() { | 72 FileChooser::~FileChooser() { |
| 73 } | 73 } |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 const PPB_FileChooser* FileChooser::GetInterface() { | 76 const PPB_FileChooser* FileChooser::GetInterface() { |
| 77 return &ppb_filechooser; | 77 return &ppb_filechooser; |
| 78 } | 78 } |
| 79 | 79 |
| 80 int32_t FileChooser::Show(PP_CompletionCallback callback) { | 80 int32_t FileChooser::Show(PP_CompletionCallback callback) { |
| 81 NOTIMPLEMENTED(); // TODO(darin): Implement me! | 81 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
| 82 return PP_Error_Failed; | 82 return PP_ERROR_FAILED; |
| 83 } | 83 } |
| 84 | 84 |
| 85 scoped_refptr<FileRef> FileChooser::GetNextChosenFile() { | 85 scoped_refptr<FileRef> FileChooser::GetNextChosenFile() { |
| 86 NOTIMPLEMENTED(); // TODO(darin): Implement me! | 86 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
| 87 return NULL; | 87 return NULL; |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace pepper | 90 } // namespace pepper |
| OLD | NEW |