| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0; | 455 virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0; |
| 456 | 456 |
| 457 // Notifies that the number of find results has changed. | 457 // Notifies that the number of find results has changed. |
| 458 virtual void NumberOfFindResultsChanged(int identifier, | 458 virtual void NumberOfFindResultsChanged(int identifier, |
| 459 int total, | 459 int total, |
| 460 bool final_result) = 0; | 460 bool final_result) = 0; |
| 461 | 461 |
| 462 // Notifies that the index of the currently selected item has been updated. | 462 // Notifies that the index of the currently selected item has been updated. |
| 463 virtual void SelectedFindResultChanged(int identifier, int index) = 0; | 463 virtual void SelectedFindResultChanged(int identifier, int index) = 0; |
| 464 | 464 |
| 465 // Sends an async IPC to open a local file. | 465 // Sends an async IPC to open a local file. |pp_open_flags| are Pepper flags. |
| 466 typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)> | 466 typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)> |
| 467 AsyncOpenFileCallback; | 467 AsyncOpenFileCallback; |
| 468 virtual bool AsyncOpenFile(const base::FilePath& path, | 468 virtual bool AsyncOpenFile(const base::FilePath& path, |
| 469 int flags, | 469 int pp_open_flags, |
| 470 const AsyncOpenFileCallback& callback) = 0; | 470 const AsyncOpenFileCallback& callback) = 0; |
| 471 | 471 |
| 472 // These functions expose some of PepperFileSystemHost methods for | 472 // These functions expose some of PepperFileSystemHost methods for |
| 473 // PPB_FileRef_Impl (which is in webkit) to access. Once we migrate FileRef | 473 // PPB_FileRef_Impl (which is in webkit) to access. Once we migrate FileRef |
| 474 // to the new design in content/, we won't need this delegation. | 474 // to the new design in content/, we won't need this delegation. |
| 475 // TODO(victorhsieh): remove these delegation. | 475 // TODO(victorhsieh): remove these delegation. |
| 476 virtual bool IsFileSystemOpened(PP_Instance instance, | 476 virtual bool IsFileSystemOpened(PP_Instance instance, |
| 477 PP_Resource resource) const = 0; | 477 PP_Resource resource) const = 0; |
| 478 virtual PP_FileSystemType GetFileSystemType(PP_Instance instance, | 478 virtual PP_FileSystemType GetFileSystemType(PP_Instance instance, |
| 479 PP_Resource resource) const = 0; | 479 PP_Resource resource) const = 0; |
| 480 virtual GURL GetFileSystemRootUrl(PP_Instance instance, | 480 virtual GURL GetFileSystemRootUrl(PP_Instance instance, |
| 481 PP_Resource resource) const = 0; | 481 PP_Resource resource) const = 0; |
| 482 | 482 |
| 483 // Sends an async IPC to open a file through filesystem API. | 483 // Sends an async IPC to open a file through filesystem API. |
| 484 // When a file is successfully opened, |callback| is invoked with | 484 // When a file is successfully opened, |callback| is invoked with |
| 485 // PLATFORM_FILE_OK, the opened file handle, and a callback function for | 485 // PLATFORM_FILE_OK, the opened file handle, and a callback function for |
| 486 // notifying that the file is closed. When the users of this function | 486 // notifying that the file is closed. When the users of this function |
| 487 // finished using the file, they must close the file handle and then must call | 487 // finished using the file, they must close the file handle and then must call |
| 488 // the supplied callback function. | 488 // the supplied callback function. |
| 489 typedef base::Callback<void (base::PlatformFileError)> | 489 typedef base::Callback<void (base::PlatformFileError)> |
| 490 NotifyCloseFileCallback; | 490 NotifyCloseFileCallback; |
| 491 typedef base::Callback< | 491 typedef base::Callback< |
| 492 void (base::PlatformFileError error, | 492 void (base::PlatformFileError error, |
| 493 base::PassPlatformFile file, | 493 base::PassPlatformFile file, |
| 494 quota::QuotaLimitType quota_policy, | 494 quota::QuotaLimitType quota_policy, |
| 495 const NotifyCloseFileCallback& close_file_callback)> | 495 const NotifyCloseFileCallback& close_file_callback)> |
| 496 AsyncOpenFileSystemURLCallback; | 496 AsyncOpenFileSystemURLCallback; |
| 497 // |pp_open_flags| are Pepper flags. |
| 497 virtual void AsyncOpenFileSystemURL( | 498 virtual void AsyncOpenFileSystemURL( |
| 498 const GURL& path, | 499 const GURL& path, |
| 499 int flags, | 500 int pp_open_flags, |
| 500 const AsyncOpenFileSystemURLCallback& callback) = 0; | 501 const AsyncOpenFileSystemURLCallback& callback) = 0; |
| 501 | 502 |
| 502 // Callback typedefs for FileSystem related methods. | 503 // Callback typedefs for FileSystem related methods. |
| 503 typedef base::Callback<void (base::PlatformFileError)> StatusCallback; | 504 typedef base::Callback<void (base::PlatformFileError)> StatusCallback; |
| 504 typedef base::Callback<void( | 505 typedef base::Callback<void( |
| 505 const std::vector<fileapi::DirectoryEntry>& entries, | 506 const std::vector<fileapi::DirectoryEntry>& entries, |
| 506 bool has_more)> ReadDirectoryCallback; | 507 bool has_more)> ReadDirectoryCallback; |
| 507 typedef base::Callback<void( | 508 typedef base::Callback<void( |
| 508 const base::PlatformFileInfo& file_info)> MetadataCallback; | 509 const base::PlatformFileInfo& file_info)> MetadataCallback; |
| 509 | 510 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 // The loader object should set itself on the PluginInstance as the document | 695 // The loader object should set itself on the PluginInstance as the document |
| 695 // loader using set_document_loader. | 696 // loader using set_document_loader. |
| 696 virtual void HandleDocumentLoad(PluginInstance* instance, | 697 virtual void HandleDocumentLoad(PluginInstance* instance, |
| 697 const WebKit::WebURLResponse& response) = 0; | 698 const WebKit::WebURLResponse& response) = 0; |
| 698 }; | 699 }; |
| 699 | 700 |
| 700 } // namespace ppapi | 701 } // namespace ppapi |
| 701 } // namespace webkit | 702 } // namespace webkit |
| 702 | 703 |
| 703 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 704 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| OLD | NEW |