diff --git a/shell/browser/file_select_helper.cc b/shell/browser/file_select_helper.cc index 82ac43d3b82..8cc72bf0566 100644 --- a/shell/browser/file_select_helper.cc +++ b/shell/browser/file_select_helper.cc @@ -29,8 +29,6 @@ #include "content/public/browser/file_select_listener.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" -#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "net/base/filename_util.h" #include "net/base/mime_util.h" @@ -46,8 +44,6 @@ using blink::mojom::FileChooserFileInfoPtr; using blink::mojom::FileChooserParams; using blink::mojom::FileChooserParamsPtr; using content::BrowserThread; -using content::RenderViewHost; -using content::RenderWidgetHost; using content::WebContents; namespace { @@ -377,9 +373,7 @@ void FileSelectHelper::RunFileChooser( render_frame_host_ = render_frame_host; web_contents_ = WebContents::FromRenderFrameHost(render_frame_host); listener_ = std::move(listener); - observation_.Reset(); content::WebContentsObserver::Observe(web_contents_); - observation_.Observe(render_frame_host_->GetRenderViewHost()->GetWidget()); base::ThreadPool::PostTask( FROM_HERE, {base::MayBlock()}, @@ -518,13 +512,6 @@ void FileSelectHelper::EnumerateDirectoryEnd() { Release(); } -void FileSelectHelper::RenderWidgetHostDestroyed( - content::RenderWidgetHost* widget_host) { - render_frame_host_ = nullptr; - DCHECK(observation_.IsObservingSource(widget_host)); - observation_.Reset(); -} - void FileSelectHelper::RenderFrameHostChanged( content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) { diff --git a/shell/browser/file_select_helper.h b/shell/browser/file_select_helper.h index 793a63bd232..39a0d8dc914 100644 --- a/shell/browser/file_select_helper.h +++ b/shell/browser/file_select_helper.h @@ -42,7 +42,6 @@ class FileSelectHelper : public base::RefCountedThreadSafe< content::BrowserThread::DeleteOnUIThread>, public ui::SelectFileDialog::Listener, public content::WebContentsObserver, - public content::RenderWidgetHostObserver, private net::DirectoryLister::DirectoryListerDelegate { public: // disable copy @@ -98,10 +97,6 @@ class FileSelectHelper : public base::RefCountedThreadSafe< void* params) override; void FileSelectionCanceled(void* params) override; - // content::RenderWidgetHostObserver overrides. - void RenderWidgetHostDestroyed( - content::RenderWidgetHost* widget_host) override; - // content::WebContentsObserver overrides. void RenderFrameHostChanged(content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) override; @@ -220,10 +215,6 @@ class FileSelectHelper : public base::RefCountedThreadSafe< struct ActiveDirectoryEnumeration; std::unique_ptr directory_enumeration_; - base::ScopedObservation - observation_{this}; - // Temporary files only used on OSX. This class is responsible for deleting // these files when they are no longer needed. std::vector temporary_files_;