1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_
8 #include "content/public/browser/render_view_host_observer.h"
12 namespace chrome_browser_net
{
16 namespace extensions
{
20 // This class holds the Chrome specific parts of RenderViewHost, and has the
22 class ChromeRenderViewHostObserver
: public content::RenderViewHostObserver
{
24 ChromeRenderViewHostObserver(content::RenderViewHost
* render_view_host
,
25 chrome_browser_net::Predictor
* predictor
);
26 virtual ~ChromeRenderViewHostObserver();
28 // content::RenderViewHostObserver overrides.
29 virtual void RenderViewHostInitialized() OVERRIDE
;
30 virtual void RenderViewHostDestroyed(content::RenderViewHost
* rvh
) OVERRIDE
;
31 virtual void Navigate(const GURL
& url
) OVERRIDE
;
32 virtual bool OnMessageReceived(const IPC::Message
& message
) OVERRIDE
;
35 // Does extension-specific initialization when a new renderer process is
36 // created by a RenderViewHost.
37 void InitRenderViewForExtensions();
38 // Gets the extension or app (if any) that is associated with the RVH.
39 const extensions::Extension
* GetExtension();
40 // Cleans up when a RenderViewHost is removed, or on destruction.
41 void RemoveRenderViewHostForExtensions(content::RenderViewHost
* rvh
);
42 void OnFocusedNodeTouched(bool editable
);
45 chrome_browser_net::Predictor
* predictor_
;
47 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver
);
50 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_