|
|
@ -750,7 +750,7 @@ void WebContents::InitWithSessionAndOptions(
|
|
|
|
InitWithWebContents(owned_web_contents.release(), session->browser_context(),
|
|
|
|
InitWithWebContents(owned_web_contents.release(), session->browser_context(),
|
|
|
|
IsGuest());
|
|
|
|
IsGuest());
|
|
|
|
|
|
|
|
|
|
|
|
managed_web_contents()->GetView()->SetDelegate(this);
|
|
|
|
inspectable_web_contents_->GetView()->SetDelegate(this);
|
|
|
|
|
|
|
|
|
|
|
|
auto* prefs = web_contents()->GetMutableRendererPrefs();
|
|
|
|
auto* prefs = web_contents()->GetMutableRendererPrefs();
|
|
|
|
|
|
|
|
|
|
|
@ -843,7 +843,7 @@ void WebContents::InitWithExtensionView(v8::Isolate* isolate,
|
|
|
|
// Allow toggling DevTools for background pages
|
|
|
|
// Allow toggling DevTools for background pages
|
|
|
|
Observe(web_contents);
|
|
|
|
Observe(web_contents);
|
|
|
|
InitWithWebContents(web_contents, GetBrowserContext(), IsGuest());
|
|
|
|
InitWithWebContents(web_contents, GetBrowserContext(), IsGuest());
|
|
|
|
managed_web_contents()->GetView()->SetDelegate(this);
|
|
|
|
inspectable_web_contents_->GetView()->SetDelegate(this);
|
|
|
|
SecurityStateTabHelper::CreateForWebContents(web_contents);
|
|
|
|
SecurityStateTabHelper::CreateForWebContents(web_contents);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -872,23 +872,23 @@ void WebContents::InitWithWebContents(content::WebContents* web_contents,
|
|
|
|
web_preferences && web_preferences->IsEnabled(options::kOffscreen);
|
|
|
|
web_preferences && web_preferences->IsEnabled(options::kOffscreen);
|
|
|
|
|
|
|
|
|
|
|
|
// Create InspectableWebContents.
|
|
|
|
// Create InspectableWebContents.
|
|
|
|
web_contents_.reset(new InspectableWebContents(
|
|
|
|
inspectable_web_contents_.reset(new InspectableWebContents(
|
|
|
|
web_contents, browser_context->prefs(), is_guest));
|
|
|
|
web_contents, browser_context->prefs(), is_guest));
|
|
|
|
web_contents_->SetDelegate(this);
|
|
|
|
inspectable_web_contents_->SetDelegate(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WebContents::~WebContents() {
|
|
|
|
WebContents::~WebContents() {
|
|
|
|
MarkDestroyed();
|
|
|
|
MarkDestroyed();
|
|
|
|
// The destroy() is called.
|
|
|
|
// The destroy() is called.
|
|
|
|
if (managed_web_contents()) {
|
|
|
|
if (inspectable_web_contents_) {
|
|
|
|
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
|
|
|
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
|
|
|
if (type_ == Type::kBackgroundPage) {
|
|
|
|
if (type_ == Type::kBackgroundPage) {
|
|
|
|
// Background pages are owned by extensions::ExtensionHost
|
|
|
|
// Background pages are owned by extensions::ExtensionHost
|
|
|
|
managed_web_contents()->ReleaseWebContents();
|
|
|
|
inspectable_web_contents_->ReleaseWebContents();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
managed_web_contents()->GetView()->SetDelegate(nullptr);
|
|
|
|
inspectable_web_contents_->GetView()->SetDelegate(nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
if (web_contents()) {
|
|
|
|
if (web_contents()) {
|
|
|
|
RenderViewDeleted(web_contents()->GetRenderViewHost());
|
|
|
|
RenderViewDeleted(web_contents()->GetRenderViewHost());
|
|
|
@ -1102,8 +1102,8 @@ void WebContents::CloseContents(content::WebContents* source) {
|
|
|
|
autofill_driver_factory->CloseAllPopups();
|
|
|
|
autofill_driver_factory->CloseAllPopups();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (managed_web_contents())
|
|
|
|
if (inspectable_web_contents_)
|
|
|
|
managed_web_contents()->GetView()->SetDelegate(nullptr);
|
|
|
|
inspectable_web_contents_->GetView()->SetDelegate(nullptr);
|
|
|
|
for (ExtendedWebContentsObserver& observer : observers_)
|
|
|
|
for (ExtendedWebContentsObserver& observer : observers_)
|
|
|
|
observer.OnCloseContents();
|
|
|
|
observer.OnCloseContents();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1729,18 +1729,18 @@ void WebContents::DevToolsOpened() {
|
|
|
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
|
|
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
|
|
|
v8::Locker locker(isolate);
|
|
|
|
v8::Locker locker(isolate);
|
|
|
|
v8::HandleScope handle_scope(isolate);
|
|
|
|
v8::HandleScope handle_scope(isolate);
|
|
|
|
DCHECK(managed_web_contents());
|
|
|
|
DCHECK(inspectable_web_contents_);
|
|
|
|
auto handle =
|
|
|
|
auto handle = FromOrCreate(
|
|
|
|
FromOrCreate(isolate, managed_web_contents()->GetDevToolsWebContents());
|
|
|
|
isolate, inspectable_web_contents_->GetDevToolsWebContents());
|
|
|
|
devtools_web_contents_.Reset(isolate, handle.ToV8());
|
|
|
|
devtools_web_contents_.Reset(isolate, handle.ToV8());
|
|
|
|
|
|
|
|
|
|
|
|
// Set inspected tabID.
|
|
|
|
// Set inspected tabID.
|
|
|
|
base::Value tab_id(ID());
|
|
|
|
base::Value tab_id(ID());
|
|
|
|
managed_web_contents()->CallClientFunction("DevToolsAPI.setInspectedTabId",
|
|
|
|
inspectable_web_contents_->CallClientFunction("DevToolsAPI.setInspectedTabId",
|
|
|
|
&tab_id, nullptr, nullptr);
|
|
|
|
&tab_id, nullptr, nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
// Inherit owner window in devtools when it doesn't have one.
|
|
|
|
// Inherit owner window in devtools when it doesn't have one.
|
|
|
|
auto* devtools = managed_web_contents()->GetDevToolsWebContents();
|
|
|
|
auto* devtools = inspectable_web_contents_->GetDevToolsWebContents();
|
|
|
|
bool has_window = devtools->GetUserData(NativeWindowRelay::UserDataKey());
|
|
|
|
bool has_window = devtools->GetUserData(NativeWindowRelay::UserDataKey());
|
|
|
|
if (owner_window() && !has_window)
|
|
|
|
if (owner_window() && !has_window)
|
|
|
|
handle->SetOwnerWindow(devtools, owner_window());
|
|
|
|
handle->SetOwnerWindow(devtools, owner_window());
|
|
|
@ -1800,23 +1800,23 @@ void WebContents::ResetManagedWebContents(bool async) {
|
|
|
|
// is destroyed.
|
|
|
|
// is destroyed.
|
|
|
|
// //electron/patches/chromium/content_browser_main_loop.patch
|
|
|
|
// //electron/patches/chromium/content_browser_main_loop.patch
|
|
|
|
// is required to get the right quit closure for the main message loop.
|
|
|
|
// is required to get the right quit closure for the main message loop.
|
|
|
|
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE,
|
|
|
|
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
|
|
|
|
web_contents_.release());
|
|
|
|
FROM_HERE, inspectable_web_contents_.release());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
web_contents_.reset();
|
|
|
|
inspectable_web_contents_.reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
content::WebContents* WebContents::GetWebContents() const {
|
|
|
|
content::WebContents* WebContents::GetWebContents() const {
|
|
|
|
if (!web_contents_)
|
|
|
|
if (!inspectable_web_contents_)
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
return web_contents_->GetWebContents();
|
|
|
|
return inspectable_web_contents_->GetWebContents();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
content::WebContents* WebContents::GetDevToolsWebContents() const {
|
|
|
|
content::WebContents* WebContents::GetDevToolsWebContents() const {
|
|
|
|
if (!web_contents_)
|
|
|
|
if (!inspectable_web_contents_)
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
return web_contents_->GetDevToolsWebContents();
|
|
|
|
return inspectable_web_contents_->GetDevToolsWebContents();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::MarkDestroyed() {
|
|
|
|
void WebContents::MarkDestroyed() {
|
|
|
@ -1860,8 +1860,8 @@ void WebContents::WebContentsDestroyed() {
|
|
|
|
|
|
|
|
|
|
|
|
// For guest view based on OOPIF, the WebContents is released by the embedder
|
|
|
|
// For guest view based on OOPIF, the WebContents is released by the embedder
|
|
|
|
// frame, and we need to clear the reference to the memory.
|
|
|
|
// frame, and we need to clear the reference to the memory.
|
|
|
|
if (IsGuest() && managed_web_contents()) {
|
|
|
|
if (IsGuest() && inspectable_web_contents_) {
|
|
|
|
managed_web_contents()->ReleaseWebContents();
|
|
|
|
inspectable_web_contents_->ReleaseWebContents();
|
|
|
|
ResetManagedWebContents(false);
|
|
|
|
ResetManagedWebContents(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2151,33 +2151,33 @@ void WebContents::OpenDevTools(gin::Arguments* args) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DCHECK(managed_web_contents());
|
|
|
|
DCHECK(inspectable_web_contents_);
|
|
|
|
managed_web_contents()->SetDockState(state);
|
|
|
|
inspectable_web_contents_->SetDockState(state);
|
|
|
|
managed_web_contents()->ShowDevTools(activate);
|
|
|
|
inspectable_web_contents_->ShowDevTools(activate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::CloseDevTools() {
|
|
|
|
void WebContents::CloseDevTools() {
|
|
|
|
if (type_ == Type::kRemote)
|
|
|
|
if (type_ == Type::kRemote)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
DCHECK(managed_web_contents());
|
|
|
|
DCHECK(inspectable_web_contents_);
|
|
|
|
managed_web_contents()->CloseDevTools();
|
|
|
|
inspectable_web_contents_->CloseDevTools();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool WebContents::IsDevToolsOpened() {
|
|
|
|
bool WebContents::IsDevToolsOpened() {
|
|
|
|
if (type_ == Type::kRemote)
|
|
|
|
if (type_ == Type::kRemote)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
DCHECK(managed_web_contents());
|
|
|
|
DCHECK(inspectable_web_contents_);
|
|
|
|
return managed_web_contents()->IsDevToolsViewShowing();
|
|
|
|
return inspectable_web_contents_->IsDevToolsViewShowing();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool WebContents::IsDevToolsFocused() {
|
|
|
|
bool WebContents::IsDevToolsFocused() {
|
|
|
|
if (type_ == Type::kRemote)
|
|
|
|
if (type_ == Type::kRemote)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
DCHECK(managed_web_contents());
|
|
|
|
DCHECK(inspectable_web_contents_);
|
|
|
|
return managed_web_contents()->GetView()->IsDevToolsViewFocused();
|
|
|
|
return inspectable_web_contents_->GetView()->IsDevToolsViewFocused();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::EnableDeviceEmulation(
|
|
|
|
void WebContents::EnableDeviceEmulation(
|
|
|
@ -2231,10 +2231,10 @@ void WebContents::InspectElement(int x, int y) {
|
|
|
|
if (!enable_devtools_)
|
|
|
|
if (!enable_devtools_)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
DCHECK(managed_web_contents());
|
|
|
|
DCHECK(inspectable_web_contents_);
|
|
|
|
if (!managed_web_contents()->GetDevToolsWebContents())
|
|
|
|
if (!inspectable_web_contents_->GetDevToolsWebContents())
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
managed_web_contents()->InspectElement(x, y);
|
|
|
|
inspectable_web_contents_->InspectElement(x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::InspectSharedWorkerById(const std::string& workerId) {
|
|
|
|
void WebContents::InspectSharedWorkerById(const std::string& workerId) {
|
|
|
@ -2249,7 +2249,7 @@ void WebContents::InspectSharedWorkerById(const std::string& workerId) {
|
|
|
|
content::DevToolsAgentHost::kTypeSharedWorker) {
|
|
|
|
content::DevToolsAgentHost::kTypeSharedWorker) {
|
|
|
|
if (agent_host->GetId() == workerId) {
|
|
|
|
if (agent_host->GetId() == workerId) {
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
managed_web_contents()->AttachTo(agent_host);
|
|
|
|
inspectable_web_contents_->AttachTo(agent_host);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2286,7 +2286,7 @@ void WebContents::InspectSharedWorker() {
|
|
|
|
if (agent_host->GetType() ==
|
|
|
|
if (agent_host->GetType() ==
|
|
|
|
content::DevToolsAgentHost::kTypeSharedWorker) {
|
|
|
|
content::DevToolsAgentHost::kTypeSharedWorker) {
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
managed_web_contents()->AttachTo(agent_host);
|
|
|
|
inspectable_web_contents_->AttachTo(agent_host);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2303,7 +2303,7 @@ void WebContents::InspectServiceWorker() {
|
|
|
|
if (agent_host->GetType() ==
|
|
|
|
if (agent_host->GetType() ==
|
|
|
|
content::DevToolsAgentHost::kTypeServiceWorker) {
|
|
|
|
content::DevToolsAgentHost::kTypeServiceWorker) {
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
OpenDevTools(nullptr);
|
|
|
|
managed_web_contents()->AttachTo(agent_host);
|
|
|
|
inspectable_web_contents_->AttachTo(agent_host);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3114,8 +3114,8 @@ void WebContents::SetEmbedder(const WebContents* embedder) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::SetDevToolsWebContents(const WebContents* devtools) {
|
|
|
|
void WebContents::SetDevToolsWebContents(const WebContents* devtools) {
|
|
|
|
if (managed_web_contents())
|
|
|
|
if (inspectable_web_contents_)
|
|
|
|
managed_web_contents()->SetDevToolsWebContents(devtools->web_contents());
|
|
|
|
inspectable_web_contents_->SetDevToolsWebContents(devtools->web_contents());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
v8::Local<v8::Value> WebContents::GetNativeView(v8::Isolate* isolate) const {
|
|
|
|
v8::Local<v8::Value> WebContents::GetNativeView(v8::Isolate* isolate) const {
|
|
|
@ -3311,8 +3311,8 @@ void WebContents::DevToolsSaveToFile(const std::string& url,
|
|
|
|
settings.default_path = base::FilePath::FromUTF8Unsafe(url);
|
|
|
|
settings.default_path = base::FilePath::FromUTF8Unsafe(url);
|
|
|
|
if (!file_dialog::ShowSaveDialogSync(settings, &path)) {
|
|
|
|
if (!file_dialog::ShowSaveDialogSync(settings, &path)) {
|
|
|
|
base::Value url_value(url);
|
|
|
|
base::Value url_value(url);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.canceledSaveURL",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&url_value, nullptr, nullptr);
|
|
|
|
"DevToolsAPI.canceledSaveURL", &url_value, nullptr, nullptr);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3321,8 +3321,8 @@ void WebContents::DevToolsSaveToFile(const std::string& url,
|
|
|
|
// Notify DevTools.
|
|
|
|
// Notify DevTools.
|
|
|
|
base::Value url_value(url);
|
|
|
|
base::Value url_value(url);
|
|
|
|
base::Value file_system_path_value(path.AsUTF8Unsafe());
|
|
|
|
base::Value file_system_path_value(path.AsUTF8Unsafe());
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.savedURL", &url_value,
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&file_system_path_value, nullptr);
|
|
|
|
"DevToolsAPI.savedURL", &url_value, &file_system_path_value, nullptr);
|
|
|
|
file_task_runner_->PostTask(FROM_HERE,
|
|
|
|
file_task_runner_->PostTask(FROM_HERE,
|
|
|
|
base::BindOnce(&WriteToFile, path, content));
|
|
|
|
base::BindOnce(&WriteToFile, path, content));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3335,8 +3335,8 @@ void WebContents::DevToolsAppendToFile(const std::string& url,
|
|
|
|
|
|
|
|
|
|
|
|
// Notify DevTools.
|
|
|
|
// Notify DevTools.
|
|
|
|
base::Value url_value(url);
|
|
|
|
base::Value url_value(url);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.appendedToURL", &url_value,
|
|
|
|
inspectable_web_contents_->CallClientFunction("DevToolsAPI.appendedToURL",
|
|
|
|
nullptr, nullptr);
|
|
|
|
&url_value, nullptr, nullptr);
|
|
|
|
file_task_runner_->PostTask(
|
|
|
|
file_task_runner_->PostTask(
|
|
|
|
FROM_HERE, base::BindOnce(&AppendToFile, it->second, content));
|
|
|
|
FROM_HERE, base::BindOnce(&AppendToFile, it->second, content));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3345,9 +3345,9 @@ void WebContents::DevToolsRequestFileSystems() {
|
|
|
|
auto file_system_paths = GetAddedFileSystemPaths(GetDevToolsWebContents());
|
|
|
|
auto file_system_paths = GetAddedFileSystemPaths(GetDevToolsWebContents());
|
|
|
|
if (file_system_paths.empty()) {
|
|
|
|
if (file_system_paths.empty()) {
|
|
|
|
base::ListValue empty_file_system_value;
|
|
|
|
base::ListValue empty_file_system_value;
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.fileSystemsLoaded",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&empty_file_system_value, nullptr,
|
|
|
|
"DevToolsAPI.fileSystemsLoaded", &empty_file_system_value, nullptr,
|
|
|
|
nullptr);
|
|
|
|
nullptr);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3366,8 +3366,8 @@ void WebContents::DevToolsRequestFileSystems() {
|
|
|
|
base::ListValue file_system_value;
|
|
|
|
base::ListValue file_system_value;
|
|
|
|
for (const auto& file_system : file_systems)
|
|
|
|
for (const auto& file_system : file_systems)
|
|
|
|
file_system_value.Append(CreateFileSystemValue(file_system));
|
|
|
|
file_system_value.Append(CreateFileSystemValue(file_system));
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.fileSystemsLoaded",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&file_system_value, nullptr, nullptr);
|
|
|
|
"DevToolsAPI.fileSystemsLoaded", &file_system_value, nullptr, nullptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::DevToolsAddFileSystem(
|
|
|
|
void WebContents::DevToolsAddFileSystem(
|
|
|
@ -3400,13 +3400,13 @@ void WebContents::DevToolsAddFileSystem(
|
|
|
|
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
|
|
|
|
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
|
|
|
|
update.Get()->SetWithoutPathExpansion(path.AsUTF8Unsafe(),
|
|
|
|
update.Get()->SetWithoutPathExpansion(path.AsUTF8Unsafe(),
|
|
|
|
std::make_unique<base::Value>(type));
|
|
|
|
std::make_unique<base::Value>(type));
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.fileSystemAdded", nullptr,
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
file_system_value.get(), nullptr);
|
|
|
|
"DevToolsAPI.fileSystemAdded", nullptr, file_system_value.get(), nullptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::DevToolsRemoveFileSystem(
|
|
|
|
void WebContents::DevToolsRemoveFileSystem(
|
|
|
|
const base::FilePath& file_system_path) {
|
|
|
|
const base::FilePath& file_system_path) {
|
|
|
|
if (!web_contents_)
|
|
|
|
if (!inspectable_web_contents_)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
std::string path = file_system_path.AsUTF8Unsafe();
|
|
|
|
std::string path = file_system_path.AsUTF8Unsafe();
|
|
|
@ -3418,8 +3418,9 @@ void WebContents::DevToolsRemoveFileSystem(
|
|
|
|
update.Get()->RemoveWithoutPathExpansion(path, nullptr);
|
|
|
|
update.Get()->RemoveWithoutPathExpansion(path, nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
base::Value file_system_path_value(path);
|
|
|
|
base::Value file_system_path_value(path);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.fileSystemRemoved",
|
|
|
|
inspectable_web_contents_->CallClientFunction("DevToolsAPI.fileSystemRemoved",
|
|
|
|
&file_system_path_value, nullptr, nullptr);
|
|
|
|
&file_system_path_value,
|
|
|
|
|
|
|
|
nullptr, nullptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::DevToolsIndexPath(
|
|
|
|
void WebContents::DevToolsIndexPath(
|
|
|
@ -3502,9 +3503,9 @@ void WebContents::OnDevToolsIndexingWorkCalculated(
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
base::Value total_work_value(total_work);
|
|
|
|
base::Value total_work_value(total_work);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&request_id_value, &file_system_path_value,
|
|
|
|
"DevToolsAPI.indexingTotalWorkCalculated", &request_id_value,
|
|
|
|
&total_work_value);
|
|
|
|
&file_system_path_value, &total_work_value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::OnDevToolsIndexingWorked(int request_id,
|
|
|
|
void WebContents::OnDevToolsIndexingWorked(int request_id,
|
|
|
@ -3513,9 +3514,9 @@ void WebContents::OnDevToolsIndexingWorked(int request_id,
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
base::Value worked_value(worked);
|
|
|
|
base::Value worked_value(worked);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.indexingWorked",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&request_id_value, &file_system_path_value,
|
|
|
|
"DevToolsAPI.indexingWorked", &request_id_value, &file_system_path_value,
|
|
|
|
&worked_value);
|
|
|
|
&worked_value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::OnDevToolsIndexingDone(int request_id,
|
|
|
|
void WebContents::OnDevToolsIndexingDone(int request_id,
|
|
|
@ -3523,9 +3524,9 @@ void WebContents::OnDevToolsIndexingDone(int request_id,
|
|
|
|
devtools_indexing_jobs_.erase(request_id);
|
|
|
|
devtools_indexing_jobs_.erase(request_id);
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.indexingDone",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&request_id_value, &file_system_path_value,
|
|
|
|
"DevToolsAPI.indexingDone", &request_id_value, &file_system_path_value,
|
|
|
|
nullptr);
|
|
|
|
nullptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::OnDevToolsSearchCompleted(
|
|
|
|
void WebContents::OnDevToolsSearchCompleted(
|
|
|
@ -3538,9 +3539,9 @@ void WebContents::OnDevToolsSearchCompleted(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value request_id_value(request_id);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
base::Value file_system_path_value(file_system_path);
|
|
|
|
web_contents_->CallClientFunction("DevToolsAPI.searchCompleted",
|
|
|
|
inspectable_web_contents_->CallClientFunction(
|
|
|
|
&request_id_value, &file_system_path_value,
|
|
|
|
"DevToolsAPI.searchCompleted", &request_id_value, &file_system_path_value,
|
|
|
|
&file_paths_value);
|
|
|
|
&file_paths_value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WebContents::SetHtmlApiFullscreen(bool enter_fullscreen) {
|
|
|
|
void WebContents::SetHtmlApiFullscreen(bool enter_fullscreen) {
|
|
|
|