diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-14 15:43:42 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-14 15:43:42 +0000 |
commit | eccf8031b30e3f8cf85b1e0dc82e69966afa30d5 (patch) | |
tree | 6c10625135c1fd95eb316fdbf496c5a5ee220c6e /webkit | |
parent | 1c7fa0a26fed6f48fbb2a7fe5724c5f9143610ff (diff) | |
download | chromium_src-eccf8031b30e3f8cf85b1e0dc82e69966afa30d5.zip chromium_src-eccf8031b30e3f8cf85b1e0dc82e69966afa30d5.tar.gz chromium_src-eccf8031b30e3f8cf85b1e0dc82e69966afa30d5.tar.bz2 |
This implements the PPB_FileChooser resource as a new-style IPC-only resource.
Note that the new file name is file_chooser_resource in the proxy. I decided to drop the ppb_ prefix for the "new-style" files to help differentiate them, and also because it's technically wrong. PPB is an interface, and a resource "object" may support multiple interfaces. I think FooResource is easier to type and read.
Review URL: https://chromiumcodereview.appspot.com/10544089
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/mock_plugin_delegate.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/mock_plugin_delegate.h | 3 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_delegate.h | 7 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_chooser_impl.cc | 288 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_chooser_impl.h | 114 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_chooser_impl_unittest.cc | 39 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_ref_impl.h | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.cc | 8 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gypi | 1 |
11 files changed, 3 insertions, 473 deletions
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index e471305..9edf509 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -263,8 +263,6 @@ '../plugins/ppapi/ppb_buffer_impl.h', '../plugins/ppapi/ppb_directory_reader_impl.cc', '../plugins/ppapi/ppb_directory_reader_impl.h', - '../plugins/ppapi/ppb_file_chooser_impl.cc', - '../plugins/ppapi/ppb_file_chooser_impl.h', '../plugins/ppapi/ppb_file_io_impl.cc', '../plugins/ppapi/ppb_file_io_impl.h', '../plugins/ppapi/ppb_file_ref_impl.cc', diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc index 08f4f2a..69279f7 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.cc +++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc @@ -130,12 +130,6 @@ void MockPluginDelegate::NumberOfFindResultsChanged(int identifier, void MockPluginDelegate::SelectedFindResultChanged(int identifier, int index) { } -bool MockPluginDelegate::RunFileChooser( - const WebKit::WebFileChooserParams& params, - WebKit::WebFileChooserCompletion* chooser_completion) { - return false; -} - bool MockPluginDelegate::AsyncOpenFile(const FilePath& path, int flags, const AsyncOpenFileCallback& callback) { diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h index 2c7d6e2..9d74c2b 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.h +++ b/webkit/plugins/ppapi/mock_plugin_delegate.h @@ -61,9 +61,6 @@ class MockPluginDelegate : public PluginDelegate { int total, bool final_result); virtual void SelectedFindResultChanged(int identifier, int index); - virtual bool RunFileChooser( - const WebKit::WebFileChooserParams& params, - WebKit::WebFileChooserCompletion* chooser_completion); virtual bool AsyncOpenFile(const FilePath& path, int flags, const AsyncOpenFileCallback& callback); diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h index 7ba136e..9c3e38c 100644 --- a/webkit/plugins/ppapi/plugin_delegate.h +++ b/webkit/plugins/ppapi/plugin_delegate.h @@ -73,12 +73,10 @@ class PlatformCanvas; } namespace WebKit { -class WebFileChooserCompletion; class WebGamepads; class WebPlugin; struct WebCompositionUnderline; struct WebCursorInfo; -struct WebFileChooserParams; } namespace webkit_glue { @@ -417,11 +415,6 @@ class PluginDelegate { // Notifies that the index of the currently selected item has been updated. virtual void SelectedFindResultChanged(int identifier, int index) = 0; - // Runs a file chooser. - virtual bool RunFileChooser( - const WebKit::WebFileChooserParams& params, - WebKit::WebFileChooserCompletion* chooser_completion) = 0; - // Sends an async IPC to open a local file. typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)> AsyncOpenFileCallback; diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl.cc b/webkit/plugins/ppapi/ppb_file_chooser_impl.cc deleted file mode 100644 index 40ef147..0000000 --- a/webkit/plugins/ppapi/ppb_file_chooser_impl.cc +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" - -#include <string> -#include <vector> - -#include "base/logging.h" -#include "base/string_split.h" -#include "base/string_util.h" -#include "base/sys_string_conversions.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/shared_impl/tracked_callback.h" -#include "ppapi/shared_impl/var.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserCompletion.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/plugins/ppapi/common.h" -#include "webkit/plugins/ppapi/ppb_file_ref_impl.h" -#include "webkit/plugins/ppapi/plugin_delegate.h" -#include "webkit/plugins/ppapi/plugin_module.h" -#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" -#include "webkit/plugins/ppapi/resource_helper.h" - -using ppapi::StringVar; -using ppapi::thunk::PPB_FileChooser_API; -using ppapi::TrackedCallback; -using WebKit::WebCString; -using WebKit::WebFileChooserCompletion; -using WebKit::WebFileChooserParams; -using WebKit::WebString; -using WebKit::WebVector; - -namespace webkit { -namespace ppapi { - -namespace { - -class FileChooserCompletionImpl : public WebFileChooserCompletion { - public: - FileChooserCompletionImpl(PPB_FileChooser_Impl* file_chooser) - : file_chooser_(file_chooser) { - DCHECK(file_chooser_); - } - - virtual ~FileChooserCompletionImpl() {} - - virtual void didChooseFile(const WebVector<WebString>& file_names) { - std::vector<PPB_FileChooser_Impl::ChosenFileInfo> files; - for (size_t i = 0; i < file_names.size(); i++) { - files.push_back( - PPB_FileChooser_Impl::ChosenFileInfo(file_names[i].utf8(), - std::string())); - } - - file_chooser_->StoreChosenFiles(files); - - // It is the responsibility of this method to delete the instance. - delete this; - } - virtual void didChooseFile(const WebVector<SelectedFileInfo>& file_names) { - std::vector<PPB_FileChooser_Impl::ChosenFileInfo> files; - for (size_t i = 0; i < file_names.size(); i++) { - files.push_back( - PPB_FileChooser_Impl::ChosenFileInfo( - file_names[i].path.utf8(), - file_names[i].displayName.utf8())); - } - - file_chooser_->StoreChosenFiles(files); - - // It is the responsibility of this method to delete the instance. - delete this; - } - - private: - scoped_refptr<PPB_FileChooser_Impl> file_chooser_; -}; - -} // namespace - -PPB_FileChooser_Impl::ChosenFileInfo::ChosenFileInfo( - const std::string& path, - const std::string& display_name) - : path(path), - display_name(display_name) { -} - -PPB_FileChooser_Impl::PPB_FileChooser_Impl( - PP_Instance instance, - PP_FileChooserMode_Dev mode, - const char* accept_types) - : Resource(::ppapi::OBJECT_IS_IMPL, instance), - mode_(mode), - next_chosen_file_index_(0) { - if (accept_types) - accept_types_ = std::string(accept_types); -} - -PPB_FileChooser_Impl::~PPB_FileChooser_Impl() { -} - -// static -PP_Resource PPB_FileChooser_Impl::Create( - PP_Instance instance, - PP_FileChooserMode_Dev mode, - const char* accept_types) { - if (mode != PP_FILECHOOSERMODE_OPEN && - mode != PP_FILECHOOSERMODE_OPENMULTIPLE) - return 0; - return (new PPB_FileChooser_Impl(instance, mode, - accept_types))->GetReference(); -} - -PPB_FileChooser_Impl* PPB_FileChooser_Impl::AsPPB_FileChooser_Impl() { - return this; -} - -PPB_FileChooser_API* PPB_FileChooser_Impl::AsPPB_FileChooser_API() { - return this; -} - -void PPB_FileChooser_Impl::StoreChosenFiles( - const std::vector<ChosenFileInfo>& files) { - next_chosen_file_index_ = 0; - - // It is possible that |callback_| has been run: before the user takes action - // on the file chooser, the page navigates away and causes the plugin module - // (whose instance requested to show the file chooser) to be destroyed. In - // that case, |callback_| has been aborted when we get here. - if (!TrackedCallback::IsPending(callback_)) { - // To be cautious, reset our internal state. - output_.Reset(); - chosen_files_.clear(); - return; - } - - std::vector< scoped_refptr<Resource> > chosen_files; - for (std::vector<ChosenFileInfo>::const_iterator it = files.begin(); - it != files.end(); ++it) { -#if defined(OS_WIN) - FilePath file_path(base::SysUTF8ToWide(it->path)); -#else - FilePath file_path(it->path); -#endif - - chosen_files.push_back(scoped_refptr<Resource>( - PPB_FileRef_Impl::CreateExternal(pp_instance(), - file_path, - it->display_name))); - } - - int32_t result_code = (chosen_files.size() > 0) ? PP_OK : PP_ERROR_USERCANCEL; - if (output_.is_valid()) - output_.StoreResourceVector(chosen_files); - else // v0.5 API. - chosen_files_.swap(chosen_files); - RunCallback(result_code); -} - -int32_t PPB_FileChooser_Impl::ValidateCallback( - scoped_refptr<TrackedCallback> callback) { - if (TrackedCallback::IsPending(callback_)) - return PP_ERROR_INPROGRESS; - - return PP_OK; -} - -void PPB_FileChooser_Impl::RegisterCallback( - scoped_refptr<TrackedCallback> callback) { - DCHECK(!TrackedCallback::IsPending(callback_)); - - PluginModule* plugin_module = ResourceHelper::GetPluginModule(this); - if (!plugin_module) - return; - - callback_ = callback; -} - -void PPB_FileChooser_Impl::RunCallback(int32_t result) { - TrackedCallback::ClearAndRun(&callback_, result); -} - -int32_t PPB_FileChooser_Impl::Show(const PP_ArrayOutput& output, - scoped_refptr<TrackedCallback> callback) { - int32_t result = Show0_5(callback); - if (result == PP_OK_COMPLETIONPENDING) - output_.set_pp_array_output(output); - return result; -} - -int32_t PPB_FileChooser_Impl::ShowWithoutUserGesture( - PP_Bool save_as, - PP_Var suggested_file_name, - const PP_ArrayOutput& output, - scoped_refptr<TrackedCallback> callback) { - int32_t result = ShowWithoutUserGesture0_5(save_as, suggested_file_name, - callback); - if (result == PP_OK_COMPLETIONPENDING) - output_.set_pp_array_output(output); - return result; -} - -int32_t PPB_FileChooser_Impl::Show0_5(scoped_refptr<TrackedCallback> callback) { - PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); - if (!plugin_instance) - return PP_ERROR_FAILED; - if (!plugin_instance->IsProcessingUserGesture()) - return PP_ERROR_NO_USER_GESTURE; - return ShowWithoutUserGesture0_5(PP_FALSE, PP_MakeUndefined(), callback); -} - -int32_t PPB_FileChooser_Impl::ShowWithoutUserGesture0_5( - PP_Bool save_as, - PP_Var suggested_file_name, - scoped_refptr<TrackedCallback> callback) { - int32_t rv = ValidateCallback(callback); - if (rv != PP_OK) - return rv; - - DCHECK((mode_ == PP_FILECHOOSERMODE_OPEN) || - (mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE)); - - WebFileChooserParams params; - if (save_as) { - params.saveAs = true; - StringVar* str = StringVar::FromPPVar(suggested_file_name); - if (str) - params.initialValue = WebString::fromUTF8(str->value().c_str()); - } else { - params.multiSelect = (mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE); - } - params.acceptTypes = ParseAcceptValue(accept_types_); - params.directory = false; - - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return PP_ERROR_FAILED; - - if (!plugin_delegate->RunFileChooser(params, - new FileChooserCompletionImpl(this))) - return PP_ERROR_FAILED; - - RegisterCallback(callback); - return PP_OK_COMPLETIONPENDING; -} - -PP_Resource PPB_FileChooser_Impl::GetNextChosenFile() { - if (next_chosen_file_index_ >= chosen_files_.size()) - return 0; - - return chosen_files_[next_chosen_file_index_++]->GetReference(); -} - -std::vector<WebString> PPB_FileChooser_Impl::ParseAcceptValue( - const std::string& accept_types) { - if (accept_types.empty()) - return std::vector<WebString>(); - std::vector<std::string> type_list; - base::SplitString(accept_types, ',', &type_list); - std::vector<WebString> normalized_type_list; - normalized_type_list.reserve(type_list.size()); - for (size_t i = 0; i < type_list.size(); ++i) { - std::string type = type_list[i]; - TrimWhitespaceASCII(type, TRIM_ALL, &type); - - // If the type is a single character, it definitely cannot be valid. In the - // case of a file extension it would be a single ".". In the case of a MIME - // type it would just be a "/". - if (type.length() < 2) - continue; - if (type.find_first_of('/') == std::string::npos && type[0] != '.') - continue; - StringToLowerASCII(&type); - normalized_type_list.push_back(WebString::fromUTF8(type.data(), - type.size())); - } - return normalized_type_list; -} - -} // namespace ppapi -} // namespace webkit diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl.h b/webkit/plugins/ppapi/ppb_file_chooser_impl.h deleted file mode 100644 index 59de2ac..0000000 --- a/webkit/plugins/ppapi/ppb_file_chooser_impl.h +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ -#define WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ - -#include <string> -#include <vector> - -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "ppapi/c/dev/ppb_file_chooser_dev.h" -#include "ppapi/shared_impl/array_writer.h" -#include "ppapi/shared_impl/resource.h" -#include "ppapi/thunk/ppb_file_chooser_api.h" -#include "webkit/plugins/webkit_plugins_export.h" - -namespace ppapi { -class TrackedCallback; -} - -namespace WebKit { -class WebString; -} - -namespace webkit { -namespace ppapi { - -class PPB_FileRef_Impl; - -class PPB_FileChooser_Impl : public ::ppapi::Resource, - public ::ppapi::thunk::PPB_FileChooser_API { - public: - // Structure to store the information of chosen files. - struct ChosenFileInfo { - ChosenFileInfo(const std::string& path, const std::string& display_name); - std::string path; - // |display_name| may be empty. - std::string display_name; - }; - - PPB_FileChooser_Impl(PP_Instance instance, - PP_FileChooserMode_Dev mode, - const char* accept_types); - virtual ~PPB_FileChooser_Impl(); - - static PP_Resource Create(PP_Instance instance, - PP_FileChooserMode_Dev mode, - const char* accept_types); - - // Resource overrides. - virtual PPB_FileChooser_Impl* AsPPB_FileChooser_Impl(); - - // Resource overrides. - virtual ::ppapi::thunk::PPB_FileChooser_API* AsPPB_FileChooser_API() OVERRIDE; - - // Stores the list of selected files. - void StoreChosenFiles(const std::vector<ChosenFileInfo>& files); - - // Check that |callback| is valid (only non-blocking operation is supported) - // and that no callback is already pending. Returns |PP_OK| if okay, else - // |PP_ERROR_...| to be returned to the plugin. - int32_t ValidateCallback(scoped_refptr< ::ppapi::TrackedCallback> callback); - - // Sets up |callback| as the pending callback. This should only be called once - // it is certain that |PP_OK_COMPLETIONPENDING| will be returned. - void RegisterCallback(scoped_refptr< ::ppapi::TrackedCallback> callback); - - void RunCallback(int32_t result); - - // PPB_FileChooser_API implementation. - virtual int32_t Show( - const PP_ArrayOutput& output, - scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; - virtual int32_t ShowWithoutUserGesture( - PP_Bool save_as, - PP_Var suggested_file_name, - const PP_ArrayOutput& output, - scoped_refptr< ::ppapi::TrackedCallback> callback); - virtual int32_t Show0_5( - scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; - virtual PP_Resource GetNextChosenFile() OVERRIDE; - virtual int32_t ShowWithoutUserGesture0_5( - PP_Bool save_as, - PP_Var suggested_file_name, - scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; - - // Splits a comma-separated MIME type/extension list |accept_types|, trims the - // resultant split types, makes them lowercase, and returns them. - // Though this should be private, this is public for testing. - WEBKIT_PLUGINS_EXPORT static std::vector<WebKit::WebString> ParseAcceptValue( - const std::string& accept_types); - - private: - PP_FileChooserMode_Dev mode_; - std::string accept_types_; - scoped_refptr< ::ppapi::TrackedCallback> callback_; - - // When using the v0.6 of the API, this will contain the output for the - // resources when the show command is complete. When using 0.5, this - // object will be is_null() and the chosen_files_ will be used instead. - ::ppapi::ArrayWriter output_; - - // Used to store and iterate over the results when using 0.5 of the API. - // These are valid when we get a file result and output_ is not null. - std::vector< scoped_refptr<Resource> > chosen_files_; - size_t next_chosen_file_index_; -}; - -} // namespace ppapi -} // namespace webkit - -#endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_CHOOSER_IMPL_H_ diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl_unittest.cc b/webkit/plugins/ppapi/ppb_file_chooser_impl_unittest.cc deleted file mode 100644 index 129566f..0000000 --- a/webkit/plugins/ppapi/ppb_file_chooser_impl_unittest.cc +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" -#include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" - -using WebKit::WebString; - -namespace webkit { -namespace ppapi { - -TEST(PPB_FileChooser_ImplTest, ParseAcceptValue) { - std::vector<WebString> parsed; - - parsed = PPB_FileChooser_Impl::ParseAcceptValue(""); - EXPECT_EQ(0U, parsed.size()); - - parsed = PPB_FileChooser_Impl::ParseAcceptValue(" "); - EXPECT_EQ(0U, parsed.size()); - - parsed = PPB_FileChooser_Impl::ParseAcceptValue("a"); - EXPECT_EQ(0U, parsed.size()); - - parsed = PPB_FileChooser_Impl::ParseAcceptValue(",, "); - EXPECT_EQ(0U, parsed.size()); - - parsed = PPB_FileChooser_Impl::ParseAcceptValue( - "IMAGE/*,,!!,,text/plain, audio /(*) "); - EXPECT_EQ(3U, parsed.size()); - EXPECT_EQ("image/*", parsed[0]); - EXPECT_EQ("text/plain", parsed[1]); - // We don't need to reject invalid MIME tokens strictly. - EXPECT_EQ("audio /(*)", parsed[2]); -} - -} // namespace ppapi -} // namespace webkit diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.h b/webkit/plugins/ppapi/ppb_file_ref_impl.h index 9b33758..d7bb8c5 100644 --- a/webkit/plugins/ppapi/ppb_file_ref_impl.h +++ b/webkit/plugins/ppapi/ppb_file_ref_impl.h @@ -12,6 +12,7 @@ #include "ppapi/c/ppb_file_ref.h" #include "ppapi/shared_impl/ppb_file_ref_shared.h" #include "ppapi/shared_impl/var.h" +#include "webkit/glue/webkit_glue_export.h" namespace webkit { namespace ppapi { @@ -20,7 +21,8 @@ using ::ppapi::StringVar; class PPB_FileSystem_Impl; -class PPB_FileRef_Impl : public ::ppapi::PPB_FileRef_Shared { +class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl + : public ::ppapi::PPB_FileRef_Shared { public: PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info, PPB_FileSystem_Impl* file_system); diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc index 8636056..3d4fd0a 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.cc +++ b/webkit/plugins/ppapi/resource_creation_impl.cc @@ -16,7 +16,6 @@ #include "webkit/plugins/ppapi/ppb_broker_impl.h" #include "webkit/plugins/ppapi/ppb_buffer_impl.h" #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" -#include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" #include "webkit/plugins/ppapi/ppb_file_io_impl.h" #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" #include "webkit/plugins/ppapi/ppb_file_system_impl.h" @@ -115,13 +114,6 @@ PP_Resource ResourceCreationImpl::CreateDirectoryReader( return PPB_DirectoryReader_Impl::Create(directory_ref); } -PP_Resource ResourceCreationImpl::CreateFileChooser( - PP_Instance instance, - PP_FileChooserMode_Dev mode, - const char* accept_types) { - return PPB_FileChooser_Impl::Create(instance, mode, accept_types); -} - PP_Resource ResourceCreationImpl::CreateFileIO(PP_Instance instance) { return (new PPB_FileIO_Impl(instance))->GetReference(); } diff --git a/webkit/plugins/ppapi/resource_creation_impl.h b/webkit/plugins/ppapi/resource_creation_impl.h index 9c5a97c..42796ed 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.h +++ b/webkit/plugins/ppapi/resource_creation_impl.h @@ -43,10 +43,6 @@ class WEBKIT_PLUGINS_EXPORT ResourceCreationImpl virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) OVERRIDE; virtual PP_Resource CreateDirectoryReader(PP_Resource directory_ref) OVERRIDE; - virtual PP_Resource CreateFileChooser( - PP_Instance instance, - PP_FileChooserMode_Dev mode, - const char* accept_types) OVERRIDE; virtual PP_Resource CreateFileIO(PP_Instance instance) OVERRIDE; virtual PP_Resource CreateFileRef(PP_Resource file_system, const char* path) OVERRIDE; diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi index 76299c6f..2ac3fae 100644 --- a/webkit/tools/test_shell/test_shell.gypi +++ b/webkit/tools/test_shell/test_shell.gypi @@ -389,7 +389,6 @@ '../../plugins/ppapi/mock_resource.h', '../../plugins/ppapi/ppapi_unittest.cc', '../../plugins/ppapi/ppapi_unittest.h', - '../../plugins/ppapi/ppb_file_chooser_impl_unittest.cc', '../../plugins/ppapi/quota_file_io_unittest.cc', '../../plugins/ppapi/time_conversion_unittest.cc', '../../plugins/ppapi/url_request_info_unittest.cc', |