| 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 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "ppapi/c/dev/ppb_file_chooser_dev.h" | 13 #include "ppapi/c/dev/ppb_file_chooser_dev.h" |
| 14 #include "ppapi/shared_impl/resource.h" | 14 #include "ppapi/shared_impl/resource.h" |
| 15 #include "ppapi/thunk/ppb_file_chooser_api.h" | 15 #include "ppapi/thunk/ppb_file_chooser_api.h" |
| 16 #include "webkit/plugins/webkit_plugins_export.h" |
| 16 | 17 |
| 17 struct PP_CompletionCallback; | 18 struct PP_CompletionCallback; |
| 18 | 19 |
| 19 namespace WebKit { | 20 namespace WebKit { |
| 20 class WebString; | 21 class WebString; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace webkit { | 24 namespace webkit { |
| 24 namespace ppapi { | 25 namespace ppapi { |
| 25 | 26 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual PP_Resource GetNextChosenFile() OVERRIDE; | 64 virtual PP_Resource GetNextChosenFile() OVERRIDE; |
| 64 | 65 |
| 65 virtual int32_t ShowWithoutUserGesture( | 66 virtual int32_t ShowWithoutUserGesture( |
| 66 bool save_as, | 67 bool save_as, |
| 67 const char* suggested_file_name, | 68 const char* suggested_file_name, |
| 68 const PP_CompletionCallback& callback) OVERRIDE; | 69 const PP_CompletionCallback& callback) OVERRIDE; |
| 69 | 70 |
| 70 // Splits a comma-separated MIME type list |accept_mime_types|, trims the | 71 // Splits a comma-separated MIME type list |accept_mime_types|, trims the |
| 71 // resultant split types, makes them lowercase, and returns them. | 72 // resultant split types, makes them lowercase, and returns them. |
| 72 // Though this should be private, this is public for testing. | 73 // Though this should be private, this is public for testing. |
| 73 static std::vector<WebKit::WebString> ParseAcceptValue( | 74 WEBKIT_PLUGINS_EXPORT static std::vector<WebKit::WebString> ParseAcceptValue( |
| 74 const std::string& accept_mime_types); | 75 const std::string& accept_mime_types); |
| 75 | 76 |
| 76 private: | 77 private: |
| 77 PP_FileChooserMode_Dev mode_; | 78 PP_FileChooserMode_Dev mode_; |
| 78 std::string accept_mime_types_; | 79 std::string accept_mime_types_; |
| 79 scoped_refptr<TrackedCompletionCallback> callback_; | 80 scoped_refptr<TrackedCompletionCallback> callback_; |
| 80 std::vector< scoped_refptr<PPB_FileRef_Impl> > chosen_files_; | 81 std::vector< scoped_refptr<PPB_FileRef_Impl> > chosen_files_; |
| 81 size_t next_chosen_file_index_; | 82 size_t next_chosen_file_index_; |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace ppapi | 85 } // namespace ppapi |
| 85 } // namespace webkit | 86 } // namespace webkit |
| 86 | 87 |
| 87 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ | 88 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ |
| OLD | NEW |