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

Unified Diff: content/browser/webui/web_ui_impl.h

Issue 1315723003: Make WebUIImpl a WebContentsObserver to re-use RenderViewCreated() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
Index: content/browser/webui/web_ui_impl.h
diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h
index c08db2927f6a33f52350d011adfda47c7f538d4e..21e8a98d18ec962a4a01d0d46c2aa6cdfc1276dd 100644
--- a/content/browser/webui/web_ui_impl.h
+++ b/content/browser/webui/web_ui_impl.h
@@ -11,25 +11,20 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
+#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_ui.h"
-#include "ipc/ipc_listener.h"
namespace content {
class RenderFrameHost;
class RenderViewHost;
class CONTENT_EXPORT WebUIImpl : public WebUI,
- public IPC::Listener,
+ public WebContentsObserver,
public base::SupportsWeakPtr<WebUIImpl> {
public:
explicit WebUIImpl(WebContents* contents);
~WebUIImpl() override;
- // Called by WebContentsImpl when the RenderView is first created. This is
- // *not* called for every page load because in some cases
- // RenderFrameHostManager will reuse RenderView instances.
- void RenderViewCreated(RenderViewHost* render_view_host);
-
// WebUI implementation:
WebContents* GetWebContents() const override;
WebUIController* GetController() const override;
@@ -68,8 +63,9 @@ class CONTENT_EXPORT WebUIImpl : public WebUI,
const std::string& function_name,
const std::vector<const base::Value*>& args) override;
- // IPC::Listener implementation:
+ // WebContentsObserver implementation:
bool OnMessageReceived(const IPC::Message& message) override;
+ void RenderViewCreated(RenderViewHost* render_view_host) override;
private:
// IPC message handling.

Powered by Google App Engine
This is Rietveld 408576698