diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 15:02:11 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 15:02:11 +0000 |
commit | eaabba206ae14905ef3a922e7b839cab285dd940 (patch) | |
tree | 13f52a325e90d2d5522ddac3e558a54eea026d06 /content/browser/renderer_host | |
parent | 15b43fba084a9880c76736167c782dea8df24a78 (diff) | |
download | chromium_src-eaabba206ae14905ef3a922e7b839cab285dd940.zip chromium_src-eaabba206ae14905ef3a922e7b839cab285dd940.tar.gz chromium_src-eaabba206ae14905ef3a922e7b839cab285dd940.tar.bz2 |
Move Render(View|Widget)Host and associated classes to content namespace.
TBR=jam@chromium.org
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9600036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host')
52 files changed, 280 insertions, 208 deletions
diff --git a/content/browser/renderer_host/backing_store.cc b/content/browser/renderer_host/backing_store.cc index 2c6edfc..63bd1a3 100644 --- a/content/browser/renderer_host/backing_store.cc +++ b/content/browser/renderer_host/backing_store.cc @@ -4,7 +4,8 @@ #include "content/browser/renderer_host/backing_store.h" -BackingStore::BackingStore(RenderWidgetHost* widget, const gfx::Size& size) +BackingStore::BackingStore(content::RenderWidgetHost* widget, + const gfx::Size& size) : render_widget_host_(widget), size_(size) { } diff --git a/content/browser/renderer_host/backing_store.h b/content/browser/renderer_host/backing_store.h index ddb7369e..203f8de 100644 --- a/content/browser/renderer_host/backing_store.h +++ b/content/browser/renderer_host/backing_store.h @@ -15,7 +15,6 @@ #include "ui/gfx/surface/transport_dib.h" class RenderProcessHost; -class RenderWidgetHost; namespace gfx { class Rect; @@ -23,6 +22,7 @@ class Rect; namespace content { class RenderProcessHost; +class RenderWidgetHost; } namespace skia { @@ -34,7 +34,9 @@ class CONTENT_EXPORT BackingStore { public: virtual ~BackingStore(); - RenderWidgetHost* render_widget_host() const { return render_widget_host_; } + content::RenderWidgetHost* render_widget_host() const { + return render_widget_host_; + } const gfx::Size& size() { return size_; } // The number of bytes that this backing store consumes. The default @@ -72,11 +74,11 @@ class CONTENT_EXPORT BackingStore { const gfx::Size& view_size) = 0; protected: // Can only be constructed via subclasses. - BackingStore(RenderWidgetHost* widget, const gfx::Size& size); + BackingStore(content::RenderWidgetHost* widget, const gfx::Size& size); private: // The owner of this backing store. - RenderWidgetHost* render_widget_host_; + content::RenderWidgetHost* render_widget_host_; // The size of the backing store. gfx::Size size_; diff --git a/content/browser/renderer_host/backing_store_gtk.cc b/content/browser/renderer_host/backing_store_gtk.cc index 06d2e66..d357968 100644 --- a/content/browser/renderer_host/backing_store_gtk.cc +++ b/content/browser/renderer_host/backing_store_gtk.cc @@ -34,6 +34,8 @@ #include "ui/gfx/rect.h" #include "ui/gfx/surface/transport_dib.h" +using content::RenderWidgetHost; + namespace { // Assume that somewhere along the line, someone will do width * height * 4 diff --git a/content/browser/renderer_host/backing_store_gtk.h b/content/browser/renderer_host/backing_store_gtk.h index 5956188..281f8cf 100644 --- a/content/browser/renderer_host/backing_store_gtk.h +++ b/content/browser/renderer_host/backing_store_gtk.h @@ -28,14 +28,14 @@ class CONTENT_EXPORT BackingStoreGtk : public BackingStore { // Create a backing store on the X server. The visual is an Xlib Visual // describing the format of the target window and the depth is the color // depth of the X window which will be drawn into. - BackingStoreGtk(RenderWidgetHost* widget, + BackingStoreGtk(content::RenderWidgetHost* widget, const gfx::Size& size, void* visual, int depth); // This is for unittesting only. An object constructed using this constructor // will silently ignore all paints - BackingStoreGtk(RenderWidgetHost* widget, const gfx::Size& size); + BackingStoreGtk(content::RenderWidgetHost* widget, const gfx::Size& size); virtual ~BackingStoreGtk(); diff --git a/content/browser/renderer_host/backing_store_mac.h b/content/browser/renderer_host/backing_store_mac.h index 4934444..90475d9 100644 --- a/content/browser/renderer_host/backing_store_mac.h +++ b/content/browser/renderer_host/backing_store_mac.h @@ -12,7 +12,7 @@ class BackingStoreMac : public BackingStore { public: - BackingStoreMac(RenderWidgetHost* widget, const gfx::Size& size); + BackingStoreMac(content::RenderWidgetHost* widget, const gfx::Size& size); virtual ~BackingStoreMac(); // A CGLayer that stores the contents of the backing store, cached in GPU diff --git a/content/browser/renderer_host/backing_store_mac.mm b/content/browser/renderer_host/backing_store_mac.mm index fa0b6f2..a7f46cf 100644 --- a/content/browser/renderer_host/backing_store_mac.mm +++ b/content/browser/renderer_host/backing_store_mac.mm @@ -26,7 +26,7 @@ // allows acclerated drawing into the layer and lets scrolling and such happen // all or mostly on the GPU, which is good for performance. -BackingStoreMac::BackingStoreMac(RenderWidgetHost* widget, +BackingStoreMac::BackingStoreMac(content::RenderWidgetHost* widget, const gfx::Size& size) : BackingStore(widget, size) { cg_layer_.reset(CreateCGLayer()); diff --git a/content/browser/renderer_host/backing_store_manager.cc b/content/browser/renderer_host/backing_store_manager.cc index 59cf785..62832e8 100644 --- a/content/browser/renderer_host/backing_store_manager.cc +++ b/content/browser/renderer_host/backing_store_manager.cc @@ -12,6 +12,8 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/common/content_switches.h" +using content::RenderWidgetHost; + namespace { // There are two separate caches, |large_cache| and |small_cache|. large_cache @@ -145,8 +147,8 @@ BackingStore* CreateBackingStore(RenderWidgetHost* host, } else { cache = small_cache; } - BackingStore* backing_store = - RenderWidgetHostImpl::From(host)->AllocBackingStore(backing_store_size); + BackingStore* backing_store = content::RenderWidgetHostImpl::From( + host)->AllocBackingStore(backing_store_size); if (backing_store) cache->Put(host, backing_store); return backing_store; diff --git a/content/browser/renderer_host/backing_store_manager.h b/content/browser/renderer_host/backing_store_manager.h index ba9e5b7..00f11e1 100644 --- a/content/browser/renderer_host/backing_store_manager.h +++ b/content/browser/renderer_host/backing_store_manager.h @@ -16,7 +16,10 @@ #include "ui/gfx/surface/transport_dib.h" class BackingStore; + +namespace content { class RenderWidgetHost; +} // This class manages backing stores in the browsr. Every RenderWidgetHost is // associated with a backing store which it requests from this class. The @@ -29,7 +32,7 @@ class BackingStoreManager { // backing_store_rect // The desired backing store dimensions. // Returns a pointer to the backing store on success, NULL on failure. - static BackingStore* GetBackingStore(RenderWidgetHost* host, + static BackingStore* GetBackingStore(content::RenderWidgetHost* host, const gfx::Size& desired_size); // Makes a backing store which is fully ready for consumption, i.e. the @@ -45,7 +48,7 @@ class BackingStoreManager { // Set if we need to send out a request to paint the view // to the renderer. static void PrepareBackingStore( - RenderWidgetHost* host, + content::RenderWidgetHost* host, const gfx::Size& backing_store_size, TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect, @@ -56,10 +59,10 @@ class BackingStoreManager { // Returns a matching backing store for the host. // Returns NULL if we fail to find one. - static BackingStore* Lookup(RenderWidgetHost* host); + static BackingStore* Lookup(content::RenderWidgetHost* host); // Removes the backing store for the host. - static void RemoveBackingStore(RenderWidgetHost* host); + static void RemoveBackingStore(content::RenderWidgetHost* host); // Removes all backing stores. static void RemoveAllBackingStores(); diff --git a/content/browser/renderer_host/backing_store_skia.cc b/content/browser/renderer_host/backing_store_skia.cc index 300e4fe..cb76b7b 100644 --- a/content/browser/renderer_host/backing_store_skia.cc +++ b/content/browser/renderer_host/backing_store_skia.cc @@ -18,7 +18,7 @@ // Max height and width for layers static const int kMaxVideoLayerSize = 23170; -BackingStoreSkia::BackingStoreSkia(RenderWidgetHost* widget, +BackingStoreSkia::BackingStoreSkia(content::RenderWidgetHost* widget, const gfx::Size& size) : BackingStore(widget, size) { bitmap_.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height()); diff --git a/content/browser/renderer_host/backing_store_skia.h b/content/browser/renderer_host/backing_store_skia.h index b713a84..beb110d 100644 --- a/content/browser/renderer_host/backing_store_skia.h +++ b/content/browser/renderer_host/backing_store_skia.h @@ -28,7 +28,7 @@ class RenderProcessHost; class BackingStoreSkia : public BackingStore { public: CONTENT_EXPORT BackingStoreSkia( - RenderWidgetHost* widget, + content::RenderWidgetHost* widget, const gfx::Size& size); virtual ~BackingStoreSkia(); diff --git a/content/browser/renderer_host/backing_store_win.cc b/content/browser/renderer_host/backing_store_win.cc index 0f1409a..45e402e 100644 --- a/content/browser/renderer_host/backing_store_win.cc +++ b/content/browser/renderer_host/backing_store_win.cc @@ -69,7 +69,7 @@ void CallStretchDIBits(HDC hdc, int dest_x, int dest_y, int dest_w, int dest_h, } // namespace -BackingStoreWin::BackingStoreWin(RenderWidgetHost* widget, +BackingStoreWin::BackingStoreWin(content::RenderWidgetHost* widget, const gfx::Size& size) : BackingStore(widget, size), backing_store_dib_(NULL), diff --git a/content/browser/renderer_host/backing_store_win.h b/content/browser/renderer_host/backing_store_win.h index 89c9cea..462740b 100644 --- a/content/browser/renderer_host/backing_store_win.h +++ b/content/browser/renderer_host/backing_store_win.h @@ -14,7 +14,7 @@ class BackingStoreWin : public BackingStore { public: - BackingStoreWin(RenderWidgetHost* widget, const gfx::Size& size); + BackingStoreWin(content::RenderWidgetHost* widget, const gfx::Size& size); virtual ~BackingStoreWin(); HDC hdc() { return hdc_; } diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.cc b/content/browser/renderer_host/gtk_im_context_wrapper.cc index 63b89a6..e5a54c6 100644 --- a/content/browser/renderer_host/gtk_im_context_wrapper.cc +++ b/content/browser/renderer_host/gtk_im_context_wrapper.cc @@ -21,6 +21,8 @@ #include "ui/gfx/gtk_util.h" #include "ui/gfx/rect.h" +using content::RenderWidgetHostImpl; + namespace { // Copied from third_party/WebKit/Source/WebCore/page/EventHandler.cpp // diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc index 02484f6..65cd52e 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc @@ -18,6 +18,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" using content::BrowserThread; +using content::RenderViewHost; namespace { class JavaBridgeThread : public base::Thread { diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h index 1a34a0b..0757ceb 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h @@ -11,11 +11,14 @@ #include "content/public/browser/render_view_host_observer.h" class NPChannelBase; -class RenderViewHost; class RouteIDGenerator; struct NPObject; struct NPVariant_Param; +namespace content { +class RenderViewHost; +} + // This class handles injecting Java objects into a single RenderView. The Java // object itself lives in the browser process on a background thread, while a // proxy object is created in the renderer. An instance of this class exists @@ -25,7 +28,7 @@ class JavaBridgeDispatcherHost public content::RenderViewHostObserver { public: // We hold a weak pointer to the RenderViewhost. It must outlive this object. - JavaBridgeDispatcherHost(RenderViewHost* render_view_host); + JavaBridgeDispatcherHost(content::RenderViewHost* render_view_host); // Injects |object| into the main frame of the corresponding RenderView. A // proxy object is created in the renderer and when the main frame's window @@ -43,7 +46,7 @@ class JavaBridgeDispatcherHost // The IPC macros require this to be public. virtual bool Send(IPC::Message* msg) OVERRIDE; virtual void RenderViewHostDestroyed( - RenderViewHost* render_view_host) OVERRIDE; + content::RenderViewHost* render_view_host) OVERRIDE; private: friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>; diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc index 45bef2e..551d1c7 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc @@ -8,6 +8,8 @@ #include "content/browser/renderer_host/java/java_bridge_dispatcher_host.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" +using content::RenderViewHost; + JavaBridgeDispatcherHostManager::JavaBridgeDispatcherHostManager( content::WebContents* web_contents) : content::WebContentsObserver(web_contents) { diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h index bc5139b..2dd2b6c 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h @@ -14,9 +14,12 @@ #include "content/public/browser/web_contents_observer.h" class JavaBridgeDispatcherHost; -class RenderViewHost; struct NPObject; +namespace content { +class RenderViewHost; +} + // This class handles injecting Java objects into all of the RenderViews // associated with a WebContents. It manages a set of JavaBridgeDispatcherHost // objects, one per RenderViewHost. @@ -32,13 +35,16 @@ class JavaBridgeDispatcherHostManager : public content::WebContentsObserver { void RemoveNamedObject(const string16& name); // content::WebContentsObserver overrides - virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; - virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; + virtual void RenderViewCreated( + content::RenderViewHost* render_view_host) OVERRIDE; + virtual void RenderViewDeleted( + content::RenderViewHost* render_view_host) OVERRIDE; virtual void WebContentsDestroyed( content::WebContents* web_contents) OVERRIDE; private: - typedef std::map<RenderViewHost*, scoped_refptr<JavaBridgeDispatcherHost> > + typedef std::map<content::RenderViewHost*, + scoped_refptr<JavaBridgeDispatcherHost> > InstanceMap; InstanceMap instances_; typedef std::map<string16, NPObject*> ObjectMap; diff --git a/content/browser/renderer_host/pepper_message_filter.cc b/content/browser/renderer_host/pepper_message_filter.cc index e5b39f2..f17f73c 100644 --- a/content/browser/renderer_host/pepper_message_filter.cc +++ b/content/browser/renderer_host/pepper_message_filter.cc @@ -46,6 +46,7 @@ #endif // ENABLE_FLAPPER_HACKS using content::BrowserThread; +using content::RenderViewHostImpl; using ppapi::NetAddressPrivateImpl; namespace { diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc index 02bea28..32199d1 100644 --- a/content/browser/renderer_host/render_view_host_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_browsertest.cc @@ -17,6 +17,7 @@ #include "net/base/net_util.h" #include "net/test/test_server.h" +using content::RenderViewHostImpl; using content::WebContents; class RenderViewHostTest : public InProcessBrowserTest { diff --git a/content/browser/renderer_host/render_view_host_factory.cc b/content/browser/renderer_host/render_view_host_factory.cc index aa17de1..c9f307a 100644 --- a/content/browser/renderer_host/render_view_host_factory.cc +++ b/content/browser/renderer_host/render_view_host_factory.cc @@ -7,6 +7,8 @@ #include "base/logging.h" #include "content/browser/renderer_host/render_view_host_impl.h" +using content::RenderViewHost; +using content::RenderViewHostImpl; using content::SessionStorageNamespace; using content::SiteInstance; diff --git a/content/browser/renderer_host/render_view_host_factory.h b/content/browser/renderer_host/render_view_host_factory.h index ecd151e..fa33f07 100644 --- a/content/browser/renderer_host/render_view_host_factory.h +++ b/content/browser/renderer_host/render_view_host_factory.h @@ -9,9 +9,8 @@ #include "base/basictypes.h" #include "content/common/content_export.h" -class RenderViewHost; - namespace content { +class RenderViewHost; class RenderViewHostDelegate; class SessionStorageNamespace; class SiteInstance; @@ -25,7 +24,7 @@ class RenderViewHostFactory { // Creates a RenderViewHost using the currently registered factory, or the // default one if no factory is registered. Ownership of the returned // pointer will be passed to the caller. - static RenderViewHost* Create( + static content::RenderViewHost* Create( content::SiteInstance* instance, content::RenderViewHostDelegate* delegate, int routing_id, @@ -42,7 +41,7 @@ class RenderViewHostFactory { // You can derive from this class and specify an implementation for this // function to create a different kind of RenderViewHost for testing. - virtual RenderViewHost* CreateRenderViewHost( + virtual content::RenderViewHost* CreateRenderViewHost( content::SiteInstance* instance, content::RenderViewHostDelegate* delegate, int routing_id, diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index faf2a96..5f88047 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -61,16 +61,6 @@ #include "webkit/glue/webdropdata.h" using base::TimeDelta; -using content::BrowserContext; -using content::BrowserMessageFilter; -using content::BrowserThread; -using content::DomOperationNotificationDetails; -using content::DOMStorageContext; -using content::HostZoomMap; -using content::RenderViewHostDelegate; -using content::SessionStorageNamespace; -using content::SiteInstance; -using content::UserMetricsAction; using WebKit::WebConsoleMessage; using WebKit::WebDragOperation; using WebKit::WebDragOperationNone; @@ -100,14 +90,15 @@ base::i18n::TextDirection WebTextDirectionToChromeTextDirection( } // namespace +namespace content { + /////////////////////////////////////////////////////////////////////////////// // RenderViewHost, public: // static RenderViewHost* RenderViewHost::FromID(int render_process_id, int render_view_id) { - content::RenderProcessHost* process = - content::RenderProcessHost::FromID(render_process_id); + RenderProcessHost* process = RenderProcessHost::FromID(render_process_id); if (!process) return NULL; RenderWidgetHost* widget = RenderWidgetHost::FromIPCChannelListener( @@ -1685,3 +1676,5 @@ void RenderViewHostImpl::SetSwappedOut(bool is_swapped_out) { void RenderViewHostImpl::ClearPowerSaveBlockers() { STLDeleteValues(&power_save_blockers_); } + +} // namespace content diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h index 256919b..75ea00a 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -45,11 +45,7 @@ class ListValue; } namespace content { -class RenderViewHostObserver; -struct FileChooserParams; -struct ContextMenuParams; -struct Referrer; -struct ShowDesktopNotificationHostMsgParams; +class TestRenderViewHost; } namespace ui { @@ -60,15 +56,23 @@ namespace webkit_glue { struct WebAccessibility; } +namespace content { + +class RenderViewHostObserver; +struct FileChooserParams; +struct ContextMenuParams; +struct Referrer; +struct ShowDesktopNotificationHostMsgParams; + // NotificationObserver used to listen for EXECUTE_JAVASCRIPT_RESULT // notifications. -class ExecuteNotificationObserver : public content::NotificationObserver { +class ExecuteNotificationObserver : public NotificationObserver { public: explicit ExecuteNotificationObserver(int id); virtual ~ExecuteNotificationObserver(); virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE; + const NotificationSource& source, + const NotificationDetails& details) OVERRIDE; int id() const { return id_; } @@ -124,10 +128,10 @@ class CONTENT_EXPORT RenderViewHostImpl // spec) space. This is useful when restoring tabs, but most callers should // pass in NULL which will cause a new SessionStorageNamespace to be created. RenderViewHostImpl( - content::SiteInstance* instance, - content::RenderViewHostDelegate* delegate, + SiteInstance* instance, + RenderViewHostDelegate* delegate, int routing_id, - content::SessionStorageNamespace* session_storage_namespace); + SessionStorageNamespace* session_storage_namespace); virtual ~RenderViewHostImpl(); // RenderViewHost implementation. @@ -171,7 +175,7 @@ class CONTENT_EXPORT RenderViewHostImpl virtual void DisableAutoResize(const gfx::Size& new_size) OVERRIDE; virtual void EnablePreferredSizeMode() OVERRIDE; virtual void ExecuteCustomContextMenuCommand( - int action, const content::CustomContextMenuContext& context) OVERRIDE; + int action, const CustomContextMenuContext& context) OVERRIDE; virtual void ExecuteMediaPlayerActionAtLocation( const gfx::Point& location, const WebKit::WebMediaPlayerAction& action) OVERRIDE; @@ -188,32 +192,32 @@ class CONTENT_EXPORT RenderViewHostImpl virtual void ExitFullscreen() OVERRIDE; virtual void Find(int request_id, const string16& search_text, const WebKit::WebFindOptions& options) OVERRIDE; - virtual void StopFinding(content::StopFindAction action) OVERRIDE; + virtual void StopFinding(StopFindAction action) OVERRIDE; virtual void FirePageBeforeUnload(bool for_cross_site_transition) OVERRIDE; virtual void FilesSelectedInChooser(const std::vector<FilePath>& files, int permissions) OVERRIDE; - virtual content::RenderViewHostDelegate* GetDelegate() const OVERRIDE; + virtual RenderViewHostDelegate* GetDelegate() const OVERRIDE; virtual int GetEnabledBindings() const OVERRIDE; - virtual content::SessionStorageNamespace* + virtual SessionStorageNamespace* GetSessionStorageNamespace() OVERRIDE; - virtual content::SiteInstance* GetSiteInstance() const OVERRIDE; + virtual SiteInstance* GetSiteInstance() const OVERRIDE; virtual void InsertCSS(const string16& frame_xpath, const std::string& css) OVERRIDE; virtual bool IsRenderViewLive() const OVERRIDE; virtual void NotifyContextMenuClosed( - const content::CustomContextMenuContext& context) OVERRIDE; + const CustomContextMenuContext& context) OVERRIDE; virtual void NotifyMoveOrResizeStarted() OVERRIDE; virtual void ReloadFrame() OVERRIDE; virtual void SetAltErrorPageURL(const GURL& url) OVERRIDE; virtual void SetWebUIProperty(const std::string& name, const std::string& value) OVERRIDE; virtual void SetZoomLevel(double level) OVERRIDE; - virtual void Zoom(content::PageZoom zoom) OVERRIDE; + virtual void Zoom(PageZoom zoom) OVERRIDE; virtual void SyncRendererPrefs() OVERRIDE; virtual void ToggleSpeechInput() OVERRIDE; virtual void UpdateWebkitPreferences(const WebPreferences& prefs) OVERRIDE; - void set_delegate(content::RenderViewHostDelegate* d) { + void set_delegate(RenderViewHostDelegate* d) { CHECK(d); // http://crbug.com/82827 delegate_ = d; } @@ -390,12 +394,12 @@ class CONTENT_EXPORT RenderViewHostImpl // one or two places. Have the caller send the IPC message directly. protected: - friend class content::RenderViewHostObserver; + friend class RenderViewHostObserver; // Add and remove observers for filtering IPC messages. Clients must be sure // to remove the observer before they go away. - void AddObserver(content::RenderViewHostObserver* observer); - void RemoveObserver(content::RenderViewHostObserver* observer); + void AddObserver(RenderViewHostObserver* observer); + void RemoveObserver(RenderViewHostObserver* observer); // RenderWidgetHost protected overrides. virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, @@ -436,10 +440,10 @@ class CONTENT_EXPORT RenderViewHostImpl void OnMsgDidChangeLoadProgress(double load_progress); void OnMsgDocumentAvailableInMainFrame(); void OnMsgDocumentOnLoadCompletedInMainFrame(int32 page_id); - void OnMsgContextMenu(const content::ContextMenuParams& params); + void OnMsgContextMenu(const ContextMenuParams& params); void OnMsgToggleFullscreen(bool enter_fullscreen); void OnMsgOpenURL(const GURL& url, - const content::Referrer& referrer, + const Referrer& referrer, WindowOpenDisposition disposition, int64 source_frame_id); void OnMsgDidContentsPreferredSizeChange(const gfx::Size& new_size); @@ -490,9 +494,9 @@ class CONTENT_EXPORT RenderViewHostImpl void OnRequestDesktopNotificationPermission(const GURL& origin, int callback_id); void OnShowDesktopNotification( - const content::ShowDesktopNotificationHostMsgParams& params); + const ShowDesktopNotificationHostMsgParams& params); void OnCancelDesktopNotification(int notification_id); - void OnRunFileChooser(const content::FileChooserParams& params); + void OnRunFileChooser(const FileChooserParams& params); void OnWebUISend(const GURL& source_url, const std::string& name, const base::ListValue& args); void OnDomOperationResponse(const std::string& json_string, @@ -512,7 +516,7 @@ class CONTENT_EXPORT RenderViewHostImpl void ClearPowerSaveBlockers(); // Our delegate, which wants to know about changes in the RenderView. - content::RenderViewHostDelegate* delegate_; + RenderViewHostDelegate* delegate_; // The SiteInstance associated with this RenderViewHost. All pages drawn // in this RenderViewHost are part of this SiteInstance. Should not change @@ -598,7 +602,7 @@ class CONTENT_EXPORT RenderViewHostImpl PowerSaveBlockerMap power_save_blockers_; // A list of observers that filter messages. Weak references. - ObserverList<content::RenderViewHostObserver> observers_; + ObserverList<RenderViewHostObserver> observers_; DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); }; @@ -607,4 +611,6 @@ class CONTENT_EXPORT RenderViewHostImpl #pragma warning(pop) #endif +} // namespace content + #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ diff --git a/content/browser/renderer_host/render_view_host_manager_browsertest.cc b/content/browser/renderer_host/render_view_host_manager_browsertest.cc index ebe8aed..940f09b 100644 --- a/content/browser/renderer_host/render_view_host_manager_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_manager_browsertest.cc @@ -21,6 +21,7 @@ #include "net/base/net_util.h" #include "net/test/test_server.h" +using content::RenderViewHost; using content::SiteInstance; class RenderViewHostManagerTest : public InProcessBrowserTest { diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc index f230b9c..8ad0289 100644 --- a/content/browser/renderer_host/render_widget_helper.cc +++ b/content/browser/renderer_host/render_widget_helper.cc @@ -16,6 +16,7 @@ #include "content/public/browser/browser_thread.h" using content::BrowserThread; +using content::RenderViewHostImpl; // A helper used with DidReceiveUpdateMsg that we hold a pointer to in // pending_paints_. diff --git a/content/browser/renderer_host/render_widget_host_gtk.cc b/content/browser/renderer_host/render_widget_host_gtk.cc index b98eaa1..d7e6e73 100644 --- a/content/browser/renderer_host/render_widget_host_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_gtk.cc @@ -6,6 +6,8 @@ #include "content/port/browser/render_widget_host_view_port.h" +using content::RenderWidgetHostImpl; + void RenderWidgetHostImpl::OnMsgCreatePluginContainer( gfx::PluginWindowHandle id) { // TODO(piman): view_ can only be NULL with delayed view creation in diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 27c6b18..492b23f 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -47,8 +47,6 @@ using base::Time; using base::TimeDelta; using base::TimeTicks; -using content::RenderWidgetHostViewPort; -using content::UserMetricsAction; using WebKit::WebGestureEvent; using WebKit::WebInputEvent; using WebKit::WebKeyboardEvent; @@ -56,6 +54,8 @@ using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; using WebKit::WebTextDirection; +namespace { + // How long to (synchronously) wait for the renderer to respond with a // PaintRect message, when our backing-store is invalid, before giving up and // returning a null or incorrectly sized backing-store from GetBackingStore. @@ -65,8 +65,6 @@ static const int kPaintMsgTimeoutMS = 40; // How long to wait before we consider a renderer hung. static const int kHungRendererDelayMs = 20000; -namespace { - // Returns |true| if the two wheel events should be coalesced. bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, const WebMouseWheelEvent& new_event) { @@ -80,6 +78,8 @@ bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, } // namespace +namespace content { + // static RenderWidgetHost* RenderWidgetHost::FromIPCChannelListener( IPC::Channel::Listener* listener) { @@ -107,7 +107,7 @@ size_t RenderWidgetHost::BackingStoreMemorySize() { /////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostImpl -RenderWidgetHostImpl::RenderWidgetHostImpl(content::RenderProcessHost* process, +RenderWidgetHostImpl::RenderWidgetHostImpl(RenderProcessHost* process, int routing_id) : view_(NULL), renderer_initialized_(false), @@ -189,7 +189,7 @@ RenderWidgetHostImpl* RenderWidgetHostImpl::From(RenderWidgetHost* rwh) { return rwh->AsRenderWidgetHostImpl(); } -void RenderWidgetHostImpl::SetView(content::RenderWidgetHostView* view) { +void RenderWidgetHostImpl::SetView(RenderWidgetHostView* view) { view_ = RenderWidgetHostViewPort::FromRWHV(view); if (!view_) { @@ -198,7 +198,7 @@ void RenderWidgetHostImpl::SetView(content::RenderWidgetHostView* view) { } } -content::RenderProcessHost* RenderWidgetHostImpl::GetProcess() const { +RenderProcessHost* RenderWidgetHostImpl::GetProcess() const { return process_; } @@ -206,7 +206,7 @@ int RenderWidgetHostImpl::GetRoutingID() const { return routing_id_; } -content::RenderWidgetHostView* RenderWidgetHostImpl::GetView() const { +RenderWidgetHostView* RenderWidgetHostImpl::GetView() const { return view_; } @@ -323,7 +323,7 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { if (!msg_is_ok) { // The message de-serialization failed. Kill the renderer process. - content::RecordAction(UserMetricsAction("BadMessageTerminate_RWH")); + RecordAction(UserMetricsAction("BadMessageTerminate_RWH")); GetProcess()->ReceivedBadMessage(); } return handled; @@ -347,10 +347,10 @@ void RenderWidgetHostImpl::WasHidden() { process_->WidgetHidden(); bool is_visible = false; - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, - content::Source<RenderWidgetHost>(this), - content::Details<bool>(&is_visible)); + NotificationService::current()->Notify( + NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, + Source<RenderWidgetHost>(this), + Details<bool>(&is_visible)); } void RenderWidgetHostImpl::WasRestored() { @@ -377,10 +377,10 @@ void RenderWidgetHostImpl::WasRestored() { process_->WidgetRestored(); bool is_visible = true; - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, - content::Source<RenderWidgetHost>(this), - content::Details<bool>(&is_visible)); + NotificationService::current()->Notify( + NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, + Source<RenderWidgetHost>(this), + Details<bool>(&is_visible)); // It's possible for our size to be out of sync with the renderer. The // following is one case that leads to this: @@ -981,10 +981,10 @@ void RenderWidgetHostImpl::SetShouldAutoResize(bool enable) { } void RenderWidgetHostImpl::Destroy() { - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, - content::Source<RenderWidgetHost>(this), - content::NotificationService::NoDetails()); + NotificationService::current()->Notify( + NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, + Source<RenderWidgetHost>(this), + NotificationService::NoDetails()); // Tell the view to die. // Note that in the process of the view shutting down, it can call a ton @@ -1009,10 +1009,10 @@ void RenderWidgetHostImpl::CheckRendererIsUnresponsive() { } // OK, looks like we have a hung renderer! - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDERER_PROCESS_HANG, - content::Source<RenderWidgetHost>(this), - content::NotificationService::NoDetails()); + NotificationService::current()->Notify( + NOTIFICATION_RENDERER_PROCESS_HANG, + Source<RenderWidgetHost>(this), + NotificationService::NoDetails()); is_unresponsive_ = true; NotifyRendererUnresponsive(); } @@ -1082,10 +1082,10 @@ void RenderWidgetHostImpl::OnMsgRequestMove(const gfx::Rect& pos) { void RenderWidgetHostImpl::OnMsgPaintAtSizeAck(int tag, const gfx::Size& size) { PaintAtSizeAckDetails details = {tag, size}; gfx::Size size_details = size; - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, - content::Source<RenderWidgetHost>(this), - content::Details<PaintAtSizeAckDetails>(&details)); + NotificationService::current()->Notify( + NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, + Source<RenderWidgetHost>(this), + Details<PaintAtSizeAckDetails>(&details)); } void RenderWidgetHostImpl::OnMsgUpdateRect( @@ -1131,8 +1131,7 @@ void RenderWidgetHostImpl::OnMsgUpdateRect( if (dib) { if (dib->size() < size) { DLOG(WARNING) << "Transport DIB too small for given rectangle"; - content::RecordAction( - UserMetricsAction("BadMessageTerminate_RWH1")); + RecordAction(UserMetricsAction("BadMessageTerminate_RWH1")); GetProcess()->ReceivedBadMessage(); } else { UNSHIPPED_TRACE_EVENT_INSTANT2("test_latency", "UpdateRect", @@ -1217,10 +1216,10 @@ void RenderWidgetHostImpl::DidUpdateBackingStore( view_being_painted_ = false; } - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, - content::Source<RenderWidgetHost>(this), - content::NotificationService::NoDetails()); + NotificationService::current()->Notify( + NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, + Source<RenderWidgetHost>(this), + NotificationService::NoDetails()); // If we got a resize ack, then perhaps we have another resize to send? bool is_resize_ack = @@ -1261,7 +1260,7 @@ void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, int type = static_cast<int>(event_type); if (type < WebInputEvent::Undefined) { - content::RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); + RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); process_->ReceivedBadMessage(); } else if (type == WebInputEvent::MouseMove) { mouse_move_pending_ = false; @@ -1281,15 +1280,15 @@ void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, // This is used only for testing, and the other end does not use the // source object. On linux, specifying - // content::Source<RenderWidgetHost> results in a very strange + // Source<RenderWidgetHost> results in a very strange // runtime error in the epilogue of the enclosing // (OnMsgInputEventAck) method, but not on other platforms; using - // 'void' instead is just as safe (since content::NotificationSource + // 'void' instead is just as safe (since NotificationSource // is not actually typesafe) and avoids this error. - content::NotificationService::current()->Notify( - content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK, - content::Source<void>(this), - content::Details<int>(&type)); + NotificationService::current()->Notify( + NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK, + Source<void>(this), + Details<int>(&type)); } void RenderWidgetHostImpl::ProcessWheelAck(bool processed) { @@ -1315,13 +1314,13 @@ void RenderWidgetHostImpl::ProcessTouchAck( void RenderWidgetHostImpl::OnMsgFocus() { // Only RenderViewHost can deal with that message. - content::RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); + RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); GetProcess()->ReceivedBadMessage(); } void RenderWidgetHostImpl::OnMsgBlur() { // Only RenderViewHost can deal with that message. - content::RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); + RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); GetProcess()->ReceivedBadMessage(); } @@ -1587,50 +1586,50 @@ void RenderWidgetHostImpl::SelectRange(const gfx::Point& start, void RenderWidgetHostImpl::Undo() { Send(new ViewMsg_Undo(GetRoutingID())); - content::RecordAction(UserMetricsAction("Undo")); + RecordAction(UserMetricsAction("Undo")); } void RenderWidgetHostImpl::Redo() { Send(new ViewMsg_Redo(GetRoutingID())); - content::RecordAction(UserMetricsAction("Redo")); + RecordAction(UserMetricsAction("Redo")); } void RenderWidgetHostImpl::Cut() { Send(new ViewMsg_Cut(GetRoutingID())); - content::RecordAction(UserMetricsAction("Cut")); + RecordAction(UserMetricsAction("Cut")); } void RenderWidgetHostImpl::Copy() { Send(new ViewMsg_Copy(GetRoutingID())); - content::RecordAction(UserMetricsAction("Copy")); + RecordAction(UserMetricsAction("Copy")); } void RenderWidgetHostImpl::CopyToFindPboard() { #if defined(OS_MACOSX) // Windows/Linux don't have the concept of a find pasteboard. Send(new ViewMsg_CopyToFindPboard(GetRoutingID())); - content::RecordAction(UserMetricsAction("CopyToFindPboard")); + RecordAction(UserMetricsAction("CopyToFindPboard")); #endif } void RenderWidgetHostImpl::Paste() { Send(new ViewMsg_Paste(GetRoutingID())); - content::RecordAction(UserMetricsAction("Paste")); + RecordAction(UserMetricsAction("Paste")); } void RenderWidgetHostImpl::PasteAndMatchStyle() { Send(new ViewMsg_PasteAndMatchStyle(GetRoutingID())); - content::RecordAction(UserMetricsAction("PasteAndMatchStyle")); + RecordAction(UserMetricsAction("PasteAndMatchStyle")); } void RenderWidgetHostImpl::Delete() { Send(new ViewMsg_Delete(GetRoutingID())); - content::RecordAction(UserMetricsAction("DeleteSelection")); + RecordAction(UserMetricsAction("DeleteSelection")); } void RenderWidgetHostImpl::SelectAll() { Send(new ViewMsg_SelectAll(GetRoutingID())); - content::RecordAction(UserMetricsAction("SelectAll")); + RecordAction(UserMetricsAction("SelectAll")); } bool RenderWidgetHostImpl::GotResponseToLockMouseRequest(bool allowed) { if (!allowed) { @@ -1669,3 +1668,5 @@ void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id, if (ui_shim) ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); } + +} // namespace content diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index b8543e3..cf7e415 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -25,18 +25,15 @@ #include "ui/gfx/native_widget_types.h" class BackingStore; +class MockRenderWidgetHost; +class WebCursor; struct EditCommand; struct ViewHostMsg_UpdateRect_Params; -class WebCursor; namespace base { class TimeTicks; } -namespace content { -class RenderWidgetHostViewPort; -} - namespace ui { class Range; } @@ -48,16 +45,18 @@ struct WebCompositionUnderline; struct WebScreenInfo; } +namespace content { + +class RenderWidgetHostViewPort; + // This implements the RenderWidgetHost interface that is exposed to // embedders of content, and adds things only visible to content. -// -// TODO(joi): Move to content namespace. class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, public IPC::Channel::Listener { public: // routing_id can be MSG_ROUTING_NONE, in which case the next available // routing id is taken from the RenderProcessHost. - RenderWidgetHostImpl(content::RenderProcessHost* process, int routing_id); + RenderWidgetHostImpl(RenderProcessHost* process, int routing_id); virtual ~RenderWidgetHostImpl(); // Use RenderWidgetHostImpl::From(rwh) to downcast a @@ -95,9 +94,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, virtual void ForwardKeyboardEvent( const NativeWebKeyboardEvent& key_event) OVERRIDE; virtual const gfx::Point& GetLastScrollOffset() const OVERRIDE; - virtual content::RenderProcessHost* GetProcess() const OVERRIDE; + virtual RenderProcessHost* GetProcess() const OVERRIDE; virtual int GetRoutingID() const OVERRIDE; - virtual content::RenderWidgetHostView* GetView() const OVERRIDE; + virtual RenderWidgetHostView* GetView() const OVERRIDE; virtual bool IsRenderView() const OVERRIDE; virtual void PaintAtSize(TransportDIB::Handle dib_handle, int tag, @@ -114,7 +113,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, virtual void RemoveKeyboardListener(KeyboardListener* listener) OVERRIDE; // Sets the View of this RenderWidgetHost. - void SetView(content::RenderWidgetHostView* view); + void SetView(RenderWidgetHostView* view); int surface_id() const { return surface_id_; } bool renderer_accessible() { return renderer_accessible_; } @@ -414,7 +413,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, // crashes, its View is destroyed and this pointer becomes NULL, even though // render_view_host_ lives on to load another URL (creating a new View while // doing so). - content::RenderWidgetHostViewPort* view_; + RenderWidgetHostViewPort* view_; // true if a renderer has once been valid. We use this flag to display a sad // tab only when we lose our renderer and not if a paint occurs during @@ -425,10 +424,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, int hung_renderer_delay_ms_; private: - FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); - FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash); - FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint); - FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, PaintAtSize); + friend class ::MockRenderWidgetHost; // Tell this object to destroy itself. void Destroy(); @@ -534,7 +530,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, // Created during construction but initialized during Init*(). Therefore, it // is guaranteed never to be NULL, but its channel may be NULL if the // renderer crashed, so you must always check that. - content::RenderProcessHost* process_; + RenderProcessHost* process_; // The ID of the corresponding object in the Renderer Instance. int routing_id_; @@ -690,4 +686,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); }; +} // namespace content + #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ diff --git a/content/browser/renderer_host/render_widget_host_mac.cc b/content/browser/renderer_host/render_widget_host_mac.cc index 47768af..7ecbb93 100644 --- a/content/browser/renderer_host/render_widget_host_mac.cc +++ b/content/browser/renderer_host/render_widget_host_mac.cc @@ -6,6 +6,8 @@ #include "content/common/gpu/gpu_messages.h" #include "content/port/browser/render_widget_host_view_port.h" +using content::RenderWidgetHostImpl; + void RenderWidgetHostImpl::OnMsgPluginFocusChanged(bool focused, int plugin_id) { if (view_) diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index b8665e4d..04b97ac 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -27,9 +27,9 @@ using base::TimeDelta; using content::BrowserThread; - using content::BrowserThreadImpl; - +using content::RenderWidgetHost; +using content::RenderWidgetHostImpl; using WebKit::WebInputEvent; using WebKit::WebMouseWheelEvent; @@ -158,6 +158,14 @@ class MockRenderWidgetHost : public RenderWidgetHostImpl { unresponsive_timer_fired_(false) { } + // Allow poking at a few private members. + using RenderWidgetHostImpl::OnMsgPaintAtSizeAck; + using RenderWidgetHostImpl::OnMsgUpdateRect; + using RenderWidgetHostImpl::RendererExited; + using RenderWidgetHostImpl::in_flight_size_; + using RenderWidgetHostImpl::is_hidden_; + using RenderWidgetHostImpl::resize_ack_pending_; + // Tests that make sure we ignore keyboard event acknowledgments to events we // didn't send work by making sure we didn't call UnhandledKeyboardEvent(). bool unhandled_keyboard_event_called() const { diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 8a0e104..e1443cd 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -19,7 +19,7 @@ void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( // static content::RenderWidgetHostView* content::RenderWidgetHostView::CreateViewForWidget( - RenderWidgetHost* widget) { + content::RenderWidgetHost* widget) { NOTIMPLEMENTED(); return NULL; } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 16c537b..e046ae0 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -34,6 +34,8 @@ #include "ui/gfx/screen.h" #include "ui/gfx/skia_util.h" +using content::RenderWidgetHost; +using content::RenderWidgetHostImpl; using content::RenderWidgetHostView; using WebKit::WebTouchEvent; diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index f6b878c..6b248c4 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -20,6 +20,7 @@ #include "webkit/glue/webcursor.h" namespace content { +class RenderWidgetHostImpl; class RenderWidgetHostView; } @@ -35,7 +36,6 @@ namespace WebKit { class WebTouchEvent; } -class RenderWidgetHostImpl; class ImageTransportClient; class RenderWidgetHostViewAura @@ -49,7 +49,7 @@ class RenderWidgetHostViewAura // RenderWidgetHostView implementation. virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; - virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; + virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; virtual void SetSize(const gfx::Size& size) OVERRIDE; virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; @@ -166,7 +166,7 @@ class RenderWidgetHostViewAura friend class content::RenderWidgetHostView; // Should construct only via RenderWidgetHostView::CreateViewForWidget. - explicit RenderWidgetHostViewAura(RenderWidgetHost* host); + explicit RenderWidgetHostViewAura(content::RenderWidgetHost* host); private: class WindowObserver; @@ -201,7 +201,7 @@ class RenderWidgetHostViewAura ui::Compositor* GetCompositor(); // The model object. - RenderWidgetHostImpl* host_; + content::RenderWidgetHostImpl* host_; aura::Window* window_; diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index c68f513..0de5cea 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc @@ -26,7 +26,7 @@ RenderWidgetHostViewPort* RenderWidgetHostViewPort::FromRWHV( // static RenderWidgetHostViewPort* RenderWidgetHostViewPort::CreateViewForWidget( - RenderWidgetHost* widget) { + content::RenderWidgetHost* widget) { return FromRWHV(RenderWidgetHostView::CreateViewForWidget(widget)); } diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 4038787..31aa2229 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -23,10 +23,10 @@ #include "content/port/browser/render_widget_host_view_port.h" #include "ui/base/range/range.h" -class RenderWidgetHostImpl; - namespace content { +class RenderWidgetHostImpl; + // Basic implementation shared by concrete RenderWidgetHostView // subclasses. // diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc index 84efe9a..a2cf64e 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -103,6 +103,7 @@ bool MovedToCenter(const WebKit::WebMouseEvent& mouse_event, } // namespace +using content::RenderWidgetHostImpl; using content::RenderWidgetHostView; using content::RenderWidgetHostViewPort; using WebKit::WebInputEventFactory; @@ -574,7 +575,8 @@ class RenderWidgetHostViewGtkWidget { DISALLOW_IMPLICIT_CONSTRUCTORS(RenderWidgetHostViewGtkWidget); }; -RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host) +RenderWidgetHostViewGtk::RenderWidgetHostViewGtk( + content::RenderWidgetHost* widget_host) : host_(RenderWidgetHostImpl::From(widget_host)), about_to_validate_and_paint_(false), is_hidden_(false), @@ -674,7 +676,8 @@ void RenderWidgetHostViewGtk::InitAsFullscreen( DoPopupOrFullscreenInit(window, bounds); } -RenderWidgetHost* RenderWidgetHostViewGtk::GetRenderWidgetHost() const { +content::RenderWidgetHost* +RenderWidgetHostViewGtk::GetRenderWidgetHost() const { return host_; } @@ -1419,7 +1422,7 @@ void RenderWidgetHostViewGtk::ModifyEventMovementAndCoords( // static RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( - RenderWidgetHost* widget) { + content::RenderWidgetHost* widget) { return new RenderWidgetHostViewGtk(widget); } diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.h b/content/browser/renderer_host/render_widget_host_view_gtk.h index 34fce7c..5b60ec3 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.h +++ b/content/browser/renderer_host/render_widget_host_view_gtk.h @@ -26,11 +26,14 @@ #include "webkit/glue/webcursor.h" #include "webkit/plugins/npapi/gtk_plugin_container_manager.h" -class RenderWidgetHost; -class RenderWidgetHostImpl; class GtkIMContextWrapper; struct NativeWebKeyboardEvent; +namespace content { +class RenderWidgetHost; +class RenderWidgetHostImpl; +} + #if defined(OS_CHROMEOS) namespace ui { class TooltipWindowGtk; @@ -51,7 +54,7 @@ class RenderWidgetHostViewGtk : public content::RenderWidgetHostViewBase { // RenderWidgetHostView implementation. virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; - virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; + virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; virtual void SetSize(const gfx::Size& size) OVERRIDE; virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; @@ -92,7 +95,7 @@ class RenderWidgetHostViewGtk : public content::RenderWidgetHostViewBase { virtual void RenderViewGone(base::TerminationStatus status, int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; - virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) {} + virtual void WillDestroyRenderWidget(content::RenderWidgetHost* rwh) {} virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; virtual void SelectionChanged(const string16& text, size_t offset, @@ -149,7 +152,7 @@ class RenderWidgetHostViewGtk : public content::RenderWidgetHostViewBase { friend class content::RenderWidgetHostView; // Should construct only via RenderWidgetHostView::CreateViewForWidget. - explicit RenderWidgetHostViewGtk(RenderWidgetHost* widget); + explicit RenderWidgetHostViewGtk(content::RenderWidgetHost* widget); private: friend class RenderWidgetHostViewGtkWidget; @@ -186,7 +189,7 @@ class RenderWidgetHostViewGtk : public content::RenderWidgetHostViewBase { gfx::Point GetWidgetCenter(); // The model object. - RenderWidgetHostImpl* host_; + content::RenderWidgetHostImpl* host_; // The native UI widget. ui::OwnedWidgetGtk view_; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 8878ade..c273ce7 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -21,12 +21,15 @@ #include "webkit/glue/webcursor.h" @class AcceleratedPluginView; -class RenderWidgetHostImpl; class RenderWidgetHostViewMac; @protocol RenderWidgetHostViewMacDelegate; class RenderWidgetHostViewMacEditCommandHelper; @class ToolTip; +namespace content { +class RenderWidgetHostImpl; +} + @protocol RenderWidgetHostViewMacOwner - (RenderWidgetHostViewMac*)renderWidgetHostViewMac; @end @@ -169,7 +172,7 @@ class RenderWidgetHostViewMac : public content::RenderWidgetHostViewBase { // RenderWidgetHostView implementation. virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; - virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; + virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; virtual void SetSize(const gfx::Size& size) OVERRIDE; virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; @@ -310,7 +313,7 @@ class RenderWidgetHostViewMac : public content::RenderWidgetHostViewBase { // The associated Model. Can be NULL if Destroy() is called when // someone (other than superview) has retained |cocoa_view_|. - RenderWidgetHostImpl* render_widget_host_; + content::RenderWidgetHostImpl* render_widget_host_; // This is true when we are currently painting and thus should handle extra // paint requests by expanding the invalid rect rather than actually painting. @@ -354,7 +357,7 @@ class RenderWidgetHostViewMac : public content::RenderWidgetHostViewBase { // The view will associate itself with the given widget. The native view must // be hooked up immediately to the view hierarchy, or else when it is // deleted it will delete this out from under the caller. - explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); + explicit RenderWidgetHostViewMac(content::RenderWidgetHost* widget); // If the window is at the root of the plugin container hierachy, // we need to update the geometry manually. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index e7bc839..2f1e2da 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -50,6 +50,9 @@ #include "webkit/plugins/npapi/webplugin.h" using content::BrowserThread; +using content::RenderViewHostImpl; +using content::RenderWidgetHost; +using content::RenderWidgetHostImpl; using content::RenderWidgetHostView; using WebKit::WebInputEvent; using WebKit::WebInputEventFactory; diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm index 5c501aa..950810f 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm @@ -9,6 +9,8 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #import "content/browser/renderer_host/render_widget_host_view_mac.h" +using content::RenderWidgetHostImpl; + namespace { // The names of all the objc selectors w/o ':'s added to an object by // AddEditingSelectorsToClass(). diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm index caa00d8..39b5c47 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm @@ -15,6 +15,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" +using content::RenderWidgetHostImpl; + class RenderWidgetHostViewMacEditCommandHelperTest : public PlatformTest { }; diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index a02de08..9f598b7 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -66,6 +66,8 @@ using base::TimeDelta; using base::TimeTicks; using content::BrowserThread; +using content::RenderWidgetHost; +using content::RenderWidgetHostImpl; using content::RenderWidgetHostView; using ui::ViewProp; using WebKit::WebInputEvent; diff --git a/content/browser/renderer_host/render_widget_host_view_win.h b/content/browser/renderer_host/render_widget_host_view_win.h index da7f611..670c9f4d 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.h +++ b/content/browser/renderer_host/render_widget_host_view_win.h @@ -31,9 +31,12 @@ #include "webkit/glue/webcursor.h" class BackingStore; -class RenderWidgetHost; class SkRegion; +namespace content { +class RenderWidgetHost; +} + namespace gfx { class Size; class Rect; @@ -152,7 +155,7 @@ class RenderWidgetHostViewWin // RenderWidgetHostView implementation. virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; - virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; + virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; virtual void SetSize(const gfx::Size& size) OVERRIDE; virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; @@ -239,7 +242,7 @@ class RenderWidgetHostViewWin // Should construct only via RenderWidgetHostView::CreateViewForWidget. // // The view will associate itself with the given widget. - explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); + explicit RenderWidgetHostViewWin(content::RenderWidgetHost* widget); // Windows Message Handlers LRESULT OnCreate(CREATESTRUCT* create_struct); @@ -382,7 +385,7 @@ class RenderWidgetHostViewWin // The associated Model. While |this| is being Destroyed, // |render_widget_host_| is NULL and the Windows message loop is run one last // time. Message handlers must check for a NULL |render_widget_host_|. - RenderWidgetHostImpl* render_widget_host_; + content::RenderWidgetHostImpl* render_widget_host_; // When we are doing accelerated compositing HWND compositor_host_window_; diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc index af94ed1..1f99041 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.cc +++ b/content/browser/renderer_host/resource_dispatcher_host.cc @@ -89,6 +89,7 @@ using base::TimeDelta; using base::TimeTicks; using content::BrowserThread; using content::GlobalRequestID; +using content::RenderViewHostImpl; using content::ResourceContext; using content::ResourceResponse; using content::ResourceThrottle; diff --git a/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc b/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc index 74e4546..ad2b192 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc +++ b/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc @@ -19,7 +19,7 @@ class ResourceDispatcherHostBrowserTest : public InProcessBrowserTest { } protected: - RenderViewHost* render_view_host() { + content::RenderViewHost* render_view_host() { return browser()->GetSelectedWebContents()->GetRenderViewHost(); } diff --git a/content/browser/renderer_host/test_backing_store.cc b/content/browser/renderer_host/test_backing_store.cc index 4f14eb9..87c7043 100644 --- a/content/browser/renderer_host/test_backing_store.cc +++ b/content/browser/renderer_host/test_backing_store.cc @@ -4,7 +4,7 @@ #include "content/browser/renderer_host/test_backing_store.h" -TestBackingStore::TestBackingStore(RenderWidgetHost* widget, +TestBackingStore::TestBackingStore(content::RenderWidgetHost* widget, const gfx::Size& size) : BackingStore(widget, size) { } diff --git a/content/browser/renderer_host/test_backing_store.h b/content/browser/renderer_host/test_backing_store.h index d3bfa64..bd03772 100644 --- a/content/browser/renderer_host/test_backing_store.h +++ b/content/browser/renderer_host/test_backing_store.h @@ -12,7 +12,7 @@ class TestBackingStore : public BackingStore { public: - TestBackingStore(RenderWidgetHost* widget, const gfx::Size& size); + TestBackingStore(content::RenderWidgetHost* widget, const gfx::Size& size); virtual ~TestBackingStore(); // BackingStore implementation. diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index d56b8a0..2b98c57 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -27,17 +27,21 @@ using content::NavigationController; using content::NavigationEntry; using content::RenderViewHostDelegate; +using content::RenderWidgetHost; using content::SessionStorageNamespace; using content::SiteInstance; +using content::TestRenderViewHost; using webkit::forms::PasswordForm; +namespace content { + void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, int page_id, const GURL& url, - content::PageTransition transition) { + PageTransition transition) { params->page_id = page_id; params->url = url; - params->referrer = content::Referrer(); + params->referrer = Referrer(); params->transition = transition; params->redirects = std::vector<GURL>(); params->should_update_history = false; @@ -52,7 +56,7 @@ void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, } TestRenderViewHost* TestRenderViewHost::GetPendingForController( - content::NavigationController* controller) { + NavigationController* controller) { TabContents* tab_contents = static_cast<TabContents*>( controller->GetWebContents()); return static_cast<TestRenderViewHost*>( @@ -73,7 +77,7 @@ TestRenderViewHost::TestRenderViewHost(SiteInstance* instance, // For normal RenderViewHosts, this is freed when |Shutdown()| is called. // For TestRenderViewHost, the view is explicitly deleted in the destructor // below, because TestRenderWidgetHostView::Destroy() doesn't |delete this|. - SetView(new content::TestRenderWidgetHostView(this)); + SetView(new TestRenderWidgetHostView(this)); } TestRenderViewHost::~TestRenderViewHost() { @@ -112,16 +116,16 @@ bool TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) { } void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { - SendNavigateWithTransition(page_id, url, content::PAGE_TRANSITION_LINK); + SendNavigateWithTransition(page_id, url, PAGE_TRANSITION_LINK); } void TestRenderViewHost::SendNavigateWithTransition( - int page_id, const GURL& url, content::PageTransition transition) { + int page_id, const GURL& url, PageTransition transition) { ViewHostMsg_FrameNavigate_Params params; params.page_id = page_id; params.url = url; - params.referrer = content::Referrer(); + params.referrer = Referrer(); params.transition = transition; params.redirects = std::vector<GURL>(); params.should_update_history = true; @@ -160,8 +164,6 @@ void TestRenderViewHost::set_contents_mime_type(const std::string& mime_type) { contents_mime_type_ = mime_type; } -namespace content { - TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) : rwh_(RenderWidgetHostImpl::From(rwh)), is_showing_(false) { @@ -331,7 +333,7 @@ void TestRenderViewHostFactory::set_render_process_host_factory( render_process_host_factory_ = rph_factory; } -RenderViewHost* TestRenderViewHostFactory::CreateRenderViewHost( +content::RenderViewHost* TestRenderViewHostFactory::CreateRenderViewHost( SiteInstance* instance, RenderViewHostDelegate* delegate, int routing_id, diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h index 597bde2..79251da 100644 --- a/content/browser/renderer_host/test_render_view_host.h +++ b/content/browser/renderer_host/test_render_view_host.h @@ -17,6 +17,13 @@ #include "content/public/common/page_transition_types.h" #include "testing/gtest/include/gtest/gtest.h" +// This file provides a testing framework for mocking out the RenderProcessHost +// layer. It allows you to test RenderViewHost, TabContents, +// NavigationController, and other layers above that without running an actual +// renderer process. +// +// To use, derive your test base class from RenderViewHostTestHarness. + #if defined(USE_AURA) namespace aura { class RootWindow; @@ -40,22 +47,14 @@ class Rect; class TestTabContents; struct ViewHostMsg_FrameNavigate_Params; +namespace content { + // Utility function to initialize ViewHostMsg_NavigateParams_Params // with given |page_id|, |url| and |transition_type|. void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, int page_id, const GURL& url, - content::PageTransition transition_type); - -// This file provides a testing framework for mocking out the RenderProcessHost -// layer. It allows you to test RenderViewHost, TabContents, -// NavigationController, and other layers above that without running an actual -// renderer process. -// -// To use, derive your test base class from RenderViewHostTestHarness. - - -namespace content { + PageTransition transition_type); // TestRenderViewHostView ------------------------------------------------------ @@ -95,10 +94,10 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase { const WebKit::WebMouseWheelEvent& event) OVERRIDE {} // RenderWidgetHostViewPort implementation. - virtual void InitAsPopup(content::RenderWidgetHostView* parent_host_view, + virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) OVERRIDE {} virtual void InitAsFullscreen( - content::RenderWidgetHostView* reference_host_view) OVERRIDE {} + RenderWidgetHostView* reference_host_view) OVERRIDE {} virtual void DidBecomeSelected() OVERRIDE {} virtual void WasHidden() OVERRIDE {} virtual void MovePluginWindows( @@ -187,8 +186,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase { bool is_showing_; }; -} // namespace content - #if defined(COMPILER_MSVC) // See comment for same warning on RenderViewHostImpl. #pragma warning(push) @@ -204,10 +201,10 @@ class TestRenderViewHost : public RenderViewHostImpl { public: // If the given TabContnets has a pending RVH, returns it, otherwise NULL. static TestRenderViewHost* GetPendingForController( - content::NavigationController* controller); + NavigationController* controller); - TestRenderViewHost(content::SiteInstance* instance, - content::RenderViewHostDelegate* delegate, + TestRenderViewHost(SiteInstance* instance, + RenderViewHostDelegate* delegate, int routing_id); virtual ~TestRenderViewHost(); @@ -223,11 +220,11 @@ class TestRenderViewHost : public RenderViewHostImpl { void SendNavigate(int page_id, const GURL& url); // Calls OnMsgNavigate on the RenderViewHost with the given information, - // including a custom content::PageTransition. Sets the rest of the + // including a custom PageTransition. Sets the rest of the // parameters in the message to the "typical" values. This is a helper // function for simulating the most common types of loads. void SendNavigateWithTransition(int page_id, const GURL& url, - content::PageTransition transition); + PageTransition transition); // Calls OnMsgShouldCloseACK on the RenderViewHost with the given parameter. void SendShouldCloseACK(bool proceed); @@ -311,6 +308,8 @@ class TestRenderViewHost : public RenderViewHostImpl { #pragma warning(pop) #endif +} // namespace content + // TestRenderViewHostFactory --------------------------------------------------- // Manages creation of the RenderViewHosts using our special subclass. This @@ -325,7 +324,7 @@ class TestRenderViewHostFactory : public RenderViewHostFactory { virtual void set_render_process_host_factory( content::RenderProcessHostFactory* rph_factory); - virtual RenderViewHost* CreateRenderViewHost( + virtual content::RenderViewHost* CreateRenderViewHost( content::SiteInstance* instance, content::RenderViewHostDelegate* delegate, int routing_id, @@ -353,9 +352,9 @@ class RenderViewHostTestHarness : public testing::Test { content::NavigationController& controller(); virtual TestTabContents* contents(); - TestRenderViewHost* rvh(); - TestRenderViewHost* pending_rvh(); - TestRenderViewHost* active_rvh(); + content::TestRenderViewHost* rvh(); + content::TestRenderViewHost* pending_rvh(); + content::TestRenderViewHost* active_rvh(); content::BrowserContext* browser_context(); MockRenderProcessHost* process(); diff --git a/content/browser/renderer_host/text_input_client_mac.h b/content/browser/renderer_host/text_input_client_mac.h index 00c67b8..cf767995 100644 --- a/content/browser/renderer_host/text_input_client_mac.h +++ b/content/browser/renderer_host/text_input_client_mac.h @@ -14,7 +14,9 @@ template <typename T> struct DefaultSingletonTraits; +namespace content { class RenderWidgetHost; +} // This class helps with the Mac OS X dictionary popup. For the design overview, // look at this document: @@ -44,13 +46,14 @@ class TextInputClientMac { // unlock and return that stored value. // // Returns NSNotFound if the request times out or is not completed. - NSUInteger GetCharacterIndexAtPoint(RenderWidgetHost* rwh, gfx::Point point); + NSUInteger GetCharacterIndexAtPoint(content::RenderWidgetHost* rwh, + gfx::Point point); // Returns nil if the request times out or is completed. - NSAttributedString* GetAttributedSubstringFromRange(RenderWidgetHost* rwh, - NSRange range); + NSAttributedString* GetAttributedSubstringFromRange( + content::RenderWidgetHost* rwh, NSRange range); // Returns NSZeroRect if the request times out or is not completed. The result // is in WebKit coordinates. - NSRect GetFirstRectForRange(RenderWidgetHost* rwh, NSRange range); + NSRect GetFirstRectForRange(content::RenderWidgetHost* rwh, NSRange range); // When the renderer sends the ViewHostMsg reply, the RenderMessageFilter will // call the corresponding method on the IO thread to unlock the condition and diff --git a/content/browser/renderer_host/text_input_client_mac.mm b/content/browser/renderer_host/text_input_client_mac.mm index 59f0caa..933511e 100644 --- a/content/browser/renderer_host/text_input_client_mac.mm +++ b/content/browser/renderer_host/text_input_client_mac.mm @@ -10,6 +10,9 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/common/text_input_client_messages.h" +using content::RenderWidgetHost; +using content::RenderWidgetHostImpl; + // The amount of time in milliseconds that the browser process will wait for a // response from the renderer. // TODO(rsesek): Using the histogram data, find the best upper-bound for this diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm index 3ff1363..1791d32 100644 --- a/content/browser/renderer_host/text_input_client_mac_unittest.mm +++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm @@ -17,6 +17,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" +using content::RenderWidgetHostImpl; + namespace { const int64 kTaskDelayMs = 200; |