Merge pull request #204 from deepak1556/workspace_patch

fix devtools filesystem api
This commit is contained in:
Cheng Zhao 2016-03-15 21:07:51 +09:00
commit bbfa5835e7
4 changed files with 9 additions and 6 deletions

View file

@ -49,7 +49,7 @@ class DevToolsEmbedderMessageDispatcher {
virtual void AppendToFile(const std::string& url,
const std::string& content) = 0;
virtual void RequestFileSystems() = 0;
virtual void AddFileSystem() = 0;
virtual void AddFileSystem(const std::string& file_system_path) = 0;
virtual void RemoveFileSystem(const std::string& file_system_path) = 0;
virtual void UpgradeDraggedFileSystemPermissions(
const std::string& file_system_url) = 0;

View file

@ -14,6 +14,7 @@ class InspectableWebContentsDelegate {
const std::string& url, const std::string& content, bool save_as) {}
virtual void DevToolsAppendToFile(
const std::string& url, const std::string& content) {}
virtual void DevToolsRequestFileSystems() {}
virtual void DevToolsAddFileSystem(
const base::FilePath& file_system_path) {}
virtual void DevToolsRemoveFileSystem(

View file

@ -420,13 +420,15 @@ void InspectableWebContentsImpl::AppendToFile(
}
void InspectableWebContentsImpl::RequestFileSystems() {
GetDevToolsWebContents()->GetMainFrame()->ExecuteJavaScript(
base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([])"));
if (delegate_)
delegate_->DevToolsRequestFileSystems();
}
void InspectableWebContentsImpl::AddFileSystem() {
void InspectableWebContentsImpl::AddFileSystem(
const std::string& file_system_path) {
if (delegate_)
delegate_->DevToolsAddFileSystem(base::FilePath());
delegate_->DevToolsAddFileSystem(
base::FilePath::FromUTF8Unsafe(file_system_path));
}
void InspectableWebContentsImpl::RemoveFileSystem(

View file

@ -89,7 +89,7 @@ class InspectableWebContentsImpl :
void AppendToFile(const std::string& url,
const std::string& content) override;
void RequestFileSystems() override;
void AddFileSystem() override;
void AddFileSystem(const std::string& file_system_path) override;
void RemoveFileSystem(const std::string& file_system_path) override;
void UpgradeDraggedFileSystemPermissions(
const std::string& file_system_url) override;