Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2755)

Unified Diff: chrome/browser/file_select_helper.h

Issue 1132163004: Remove NOTIFICATION_RENDER_VIEW_HOST_CHANGED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments #1 Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/file_select_helper.cc » ('j') | chrome/browser/file_select_helper.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper.h
diff --git a/chrome/browser/file_select_helper.h b/chrome/browser/file_select_helper.h
index 06672ba86847110cf55ae3a0229a87958d9496e0..0067b8a11c5c4b804068fa930a83f4ce4089c568 100644
--- a/chrome/browser/file_select_helper.h
+++ b/chrome/browser/file_select_helper.h
@@ -12,6 +12,7 @@
#include "base/gtest_prod_util.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/file_chooser_params.h"
#include "net/base/directory_lister.h"
#include "ui/shell_dialogs/select_file_dialog.h"
@@ -31,10 +32,10 @@ struct SelectedFileInfo;
// This class handles file-selection requests coming from WebUI elements
// (via the extensions::ExtensionHost class). It implements both the
// initialisation and listener functions for file-selection dialogs.
-class FileSelectHelper
- : public base::RefCountedThreadSafe<FileSelectHelper>,
- public ui::SelectFileDialog::Listener,
- public content::NotificationObserver {
+class FileSelectHelper : public base::RefCountedThreadSafe<FileSelectHelper>,
+ public ui::SelectFileDialog::Listener,
+ public content::WebContentsObserver,
+ public content::NotificationObserver {
public:
// Show the file chooser dialog.
@@ -105,6 +106,11 @@ class FileSelectHelper
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ // content::WebContentsObserver overrides.
+ void RenderViewHostChanged(content::RenderViewHost* old_host,
+ content::RenderViewHost* new_host) override;
+ void WebContentsDestroyed() override;
+
void EnumerateDirectory(int request_id,
content::RenderViewHost* render_view_host,
const base::FilePath& path);
@@ -155,6 +161,9 @@ class FileSelectHelper
// vector.
void DeleteTemporaryFiles();
+ // Cleans up when the RenderViewHost of our WebContents changes.
+ void CleanUpOnRenderViewHostChange();
+
// Helper method to get allowed extensions for select file dialog from
// the specified accept types as defined in the spec:
// http://whatwg.org/html/number-state.html#attr-input-accept
« no previous file with comments | « no previous file | chrome/browser/file_select_helper.cc » ('j') | chrome/browser/file_select_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698