mirror of
https://github.com/electron/electron.git
synced 2026-01-27 08:18:28 -05:00
fix devtools filesystem api and allow delegate to request stored filesystem paths
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user