From 2db138f2dc5007acbd04566d5db037a3816c74b9 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Sat, 7 May 2016 04:36:00 +0530 Subject: [PATCH] allow delegate to handle file system indexing requests --- brightray/browser/inspectable_web_contents_delegate.h | 7 +++++++ brightray/browser/inspectable_web_contents_impl.cc | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/brightray/browser/inspectable_web_contents_delegate.h b/brightray/browser/inspectable_web_contents_delegate.h index 7f004dd4fbd8..a94bcac44d52 100644 --- a/brightray/browser/inspectable_web_contents_delegate.h +++ b/brightray/browser/inspectable_web_contents_delegate.h @@ -20,6 +20,13 @@ class InspectableWebContentsDelegate { const base::FilePath& file_system_path) {} virtual void DevToolsRemoveFileSystem( const base::FilePath& file_system_path) {} + virtual void DevToolsIndexPath( + int request_id, const std::string& file_system_path) {} + virtual void DevToolsStopIndexing(int request_id) {} + virtual void DevToolsSearchInPath( + int request_id, + const std::string& file_system_path, + const std::string& query) {} }; } // namespace brightray diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 819bdba93a5d..8353a71eb76c 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -459,15 +459,21 @@ void InspectableWebContentsImpl::UpgradeDraggedFileSystemPermissions( void InspectableWebContentsImpl::IndexPath( int request_id, const std::string& file_system_path) { + if (delegate_) + delegate_->DevToolsIndexPath(request_id, file_system_path); } void InspectableWebContentsImpl::StopIndexing(int request_id) { + if (delegate_) + delegate_->DevToolsStopIndexing(request_id); } void InspectableWebContentsImpl::SearchInPath( int request_id, const std::string& file_system_path, const std::string& query) { + if (delegate_) + delegate_->DevToolsSearchInPath(request_id, file_system_path, query); } void InspectableWebContentsImpl::SetWhitelistedShortcuts(const std::string& message) {