summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-30 01:36:27 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-30 01:36:27 +0000
commit72fd40554c56e5e5158e7205e8af3dc2421a7bbe (patch)
treec9d8c7ffcf4d2dc962da7c1c286bb980d6b129d6
parent4851523d11d5274124032d374c220f632655d441 (diff)
downloadchromium_src-72fd40554c56e5e5158e7205e8af3dc2421a7bbe.zip
chromium_src-72fd40554c56e5e5158e7205e8af3dc2421a7bbe.tar.gz
chromium_src-72fd40554c56e5e5158e7205e8af3dc2421a7bbe.tar.bz2
Remove CreateViewForWidget from ContentBrowserClient now that all the RenderWidgetHostView implementations live in content. Before this was necessary because the Views one was in chrome. Now it's been replaced with an Aura one which is in content. This is basically a revert of 104546.
BUG=90442 Review URL: http://codereview.chromium.org/9015014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116016 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_content_browser_client.cc25
-rw-r--r--chrome/browser/chrome_content_browser_client.h2
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc6
-rw-r--r--content/browser/mock_content_browser_client.cc25
-rw-r--r--content/browser/mock_content_browser_client.h2
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc3
-rw-r--r--content/browser/renderer_host/render_widget_host_view.h13
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc6
-rw-r--r--content/browser/renderer_host/render_widget_host_view_gtk.cc9
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.h16
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.mm6
-rw-r--r--content/browser/renderer_host/render_widget_host_view_win.cc9
-rw-r--r--content/public/browser/content_browser_client.h15
-rw-r--r--content/shell/shell_content_browser_client.cc10
-rw-r--r--content/shell/shell_content_browser_client.h2
15 files changed, 46 insertions, 103 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d84467f..0516417 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -125,16 +125,6 @@
#include "chrome/browser/ui/crypto_module_password_dialog.h"
#endif
-#if defined(USE_AURA)
-#include "content/browser/renderer_host/render_widget_host_view_aura.h"
-#elif defined(OS_WIN)
-#include "content/browser/renderer_host/render_widget_host_view_win.h"
-#elif defined(TOOLKIT_USES_GTK)
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
-#elif defined(OS_MACOSX)
-#include "content/browser/renderer_host/render_widget_host_view_mac.h"
-#endif
-
using content::AccessTokenStore;
using content::BrowserThread;
@@ -294,21 +284,6 @@ content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts(
return main_parts;
}
-RenderWidgetHostView* ChromeContentBrowserClient::CreateViewForWidget(
- RenderWidgetHost* widget) {
-#if defined(USE_AURA)
- return new RenderWidgetHostViewAura(widget);
-#elif defined(OS_WIN)
- return new RenderWidgetHostViewWin(widget);
-#elif defined(TOOLKIT_USES_GTK)
- return new RenderWidgetHostViewGtk(widget);
-#elif defined(OS_MACOSX)
- return render_widget_host_view_mac::CreateRenderWidgetHostView(widget);
-#else
-#error Need to create your platform ViewForWidget here.
-#endif
-}
-
TabContentsView* ChromeContentBrowserClient::CreateTabContentsView(
TabContents* tab_contents) {
#if defined(TOOLKIT_VIEWS)
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index 16097cd..adfe863 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -17,8 +17,6 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
public:
virtual content::BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) OVERRIDE;
- virtual RenderWidgetHostView* CreateViewForWidget(
- RenderWidgetHost* widget) OVERRIDE;
virtual TabContentsView* CreateTabContentsView(
TabContents* tab_contents) OVERRIDE;
virtual void RenderViewHostCreated(RenderViewHost* render_view_host) OVERRIDE;
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 59f3ab3..20ad1dc 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/background/background_contents_service.h"
#include "chrome/browser/background/background_contents_service_factory.h"
#include "chrome/browser/character_encoding.h"
-#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_webkit_preferences.h"
@@ -193,7 +192,7 @@ RenderWidgetHostView* RenderViewHostDelegateViewHelper::CreateNewWidget(
RenderWidgetHost* widget_host =
new RenderWidgetHost(process, route_id);
RenderWidgetHostView* widget_view =
- content::GetContentClient()->browser()->CreateViewForWidget(widget_host);
+ RenderWidgetHostView::CreateViewForWidget(widget_host);
// Popups should not get activated.
widget_view->set_popup_type(popup_type);
// Save the created widget associated with the route so we can show it later.
@@ -207,8 +206,7 @@ RenderViewHostDelegateViewHelper::CreateNewFullscreenWidget(
RenderWidgetFullscreenHost* fullscreen_widget_host =
new RenderWidgetFullscreenHost(process, route_id);
RenderWidgetHostView* widget_view =
- content::GetContentClient()->browser()->CreateViewForWidget(
- fullscreen_widget_host);
+ RenderWidgetHostView::CreateViewForWidget(fullscreen_widget_host);
pending_widget_views_[route_id] = widget_view;
return widget_view;
}
diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc
index 13de94f..a4ad86d 100644
--- a/content/browser/mock_content_browser_client.cc
+++ b/content/browser/mock_content_browser_client.cc
@@ -15,16 +15,6 @@
#include "ui/base/clipboard/clipboard.h"
#include "webkit/glue/webpreferences.h"
-#if defined(USE_AURA)
-#include "content/browser/renderer_host/render_widget_host_view_aura.h"
-#elif defined(OS_WIN)
-#include "content/browser/renderer_host/render_widget_host_view_win.h"
-#elif defined(TOOLKIT_USES_GTK)
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
-#elif defined(OS_MACOSX)
-#include "content/browser/renderer_host/render_widget_host_view_mac.h"
-#endif
-
namespace content {
MockContentBrowserClient::MockContentBrowserClient() {
@@ -38,21 +28,6 @@ BrowserMainParts* MockContentBrowserClient::CreateBrowserMainParts(
return NULL;
}
-RenderWidgetHostView* MockContentBrowserClient::CreateViewForWidget(
- RenderWidgetHost* widget) {
-#if defined(USE_AURA)
- return new RenderWidgetHostViewAura(widget);
-#elif defined(OS_WIN)
- return new RenderWidgetHostViewWin(widget);
-#elif defined(TOOLKIT_USES_GTK)
- return new RenderWidgetHostViewGtk(widget);
-#elif defined(OS_MACOSX)
- return render_widget_host_view_mac::CreateRenderWidgetHostView(widget);
-#else
-#error Need to create your platform ViewForWidget here.
-#endif
-}
-
TabContentsView* MockContentBrowserClient::CreateTabContentsView(
TabContents* tab_contents) {
return new TestTabContentsView;
diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h
index 37e866e..14e9d4e17 100644
--- a/content/browser/mock_content_browser_client.h
+++ b/content/browser/mock_content_browser_client.h
@@ -23,8 +23,6 @@ class MockContentBrowserClient : public ContentBrowserClient {
virtual BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) OVERRIDE;
- virtual RenderWidgetHostView* CreateViewForWidget(
- RenderWidgetHost* widget) OVERRIDE;
virtual TabContentsView* CreateTabContentsView(
TabContents* tab_contents) OVERRIDE;
virtual void RenderViewHostCreated(
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index f9f9941..1b9a894 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -10,7 +10,6 @@
#include "content/browser/renderer_host/backing_store.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/common/view_messages.h"
-#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -431,7 +430,7 @@ TEST_F(RenderWidgetHostTest, ResizeThenCrash) {
TEST_F(RenderWidgetHostTest, Background) {
#if !defined(OS_MACOSX)
scoped_ptr<RenderWidgetHostView> view(
- content::GetContentClient()->browser()->CreateViewForWidget(host_.get()));
+ RenderWidgetHostView::CreateViewForWidget(host_.get()));
#if defined(USE_AURA)
// TODO(derat): Call this on all platforms: http://crbug.com/102450.
static_cast<RenderWidgetHostViewAura*>(view.get())->InitAsChild();
diff --git a/content/browser/renderer_host/render_widget_host_view.h b/content/browser/renderer_host/render_widget_host_view.h
index b2adb5c..ee604f7 100644
--- a/content/browser/renderer_host/render_widget_host_view.h
+++ b/content/browser/renderer_host/render_widget_host_view.h
@@ -69,6 +69,19 @@ class RenderWidgetHostView {
public:
CONTENT_EXPORT virtual ~RenderWidgetHostView();
+ // Platform-specific creator. Use this to construct new RenderWidgetHostViews
+ // rather than using RenderWidgetHostViewWin & friends.
+ //
+ // This function must NOT size it, because the RenderView in the renderer
+ // wouldn't have been created yet. The widget would set its "waiting for
+ // resize ack" flag, and the ack would never come becasue no RenderView
+ // received it.
+ //
+ // The RenderWidgetHost must already be created (because we can't know if it's
+ // going to be a regular RenderWidgetHost or a RenderViewHost (a subclass).
+ CONTENT_EXPORT static RenderWidgetHostView* CreateViewForWidget(
+ RenderWidgetHost* widget);
+
// Perform all the initialization steps necessary for this object to represent
// a popup (such as a <select> dropdown), then shows the popup at |pos|.
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
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 04b6704..25b6b38 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -860,6 +860,12 @@ void RenderWidgetHostViewAura::FinishImeCompositionSession() {
// RenderWidgetHostView, public:
// static
+RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
+ RenderWidgetHost* widget) {
+ return new RenderWidgetHostViewAura(widget);
+}
+
+// static
void RenderWidgetHostView::GetDefaultScreenInfo(
WebKit::WebScreenInfo* results) {
const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize();
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 a97a314..4dd3112 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -1387,6 +1387,15 @@ void RenderWidgetHostViewGtk::ModifyEventMovementAndCoords(
}
}
+////////////////////////////////////////////////////////////////////////////////
+// RenderWidgetHostView, public:
+
+// static
+RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
+ RenderWidgetHost* widget) {
+ return new RenderWidgetHostViewGtk(widget);
+}
+
// static
void RenderWidgetHostView::GetDefaultScreenInfo(
WebKit::WebScreenInfo* results) {
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 4d5f2b3..671ffb3 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -6,8 +6,6 @@
#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
#pragma once
-#if defined(__OBJC__)
-
#import <Cocoa/Cocoa.h>
#include "base/memory/scoped_nsobject.h"
@@ -400,18 +398,4 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView {
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
};
-#endif // __OBJC__
-
-// Functions that may be accessed from non-Objective-C C/C++ code.
-
-#include "content/common/content_export.h"
-
-class RenderWidgetHostView;
-class RenderWidgetHost;
-
-namespace render_widget_host_view_mac {
-CONTENT_EXPORT RenderWidgetHostView* CreateRenderWidgetHostView(
- RenderWidgetHost* widget);
-}
-
#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
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 352bbd9..828c754 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -213,6 +213,12 @@ NSWindow* ApparentWindowForView(NSView* view) {
// RenderWidgetHostView, public:
// static
+RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
+ RenderWidgetHost* widget) {
+ return new RenderWidgetHostViewMac(widget);
+}
+
+// static
void RenderWidgetHostView::GetDefaultScreenInfo(
WebKit::WebScreenInfo* results) {
*results = WebKit::WebScreenInfoFactory::screenInfo(NULL);
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 62571a1..1120d53 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -2496,3 +2496,12 @@ LRESULT RenderWidgetHostViewWin::OnReconvertString(RECONVERTSTRING* reconv) {
// need_size.
return reinterpret_cast<LRESULT>(reconv);
}
+
+////////////////////////////////////////////////////////////////////////////////
+// RenderWidgetHostView, public:
+
+// static
+RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
+ RenderWidgetHost* widget) {
+ return new RenderWidgetHostViewWin(widget);
+}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 17ac85a..87900d3 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -22,8 +22,6 @@ class MHTMLGenerationManager;
class PluginProcessHost;
class QuotaPermissionContext;
class RenderViewHost;
-class RenderWidgetHost;
-class RenderWidgetHostView;
class ResourceDispatcherHost;
class SiteInstance;
class SSLCertErrorHandler;
@@ -87,19 +85,6 @@ class ContentBrowserClient {
virtual BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) = 0;
- // Platform-specific creator. Use this to construct new RenderWidgetHostViews
- // rather than using RenderWidgetHostViewWin & friends.
- //
- // This function must NOT size it, because the RenderView in the renderer
- // wouldn't have been created yet. The widget would set its "waiting for
- // resize ack" flag, and the ack would never come becasue no RenderView
- // received it.
- //
- // The RenderWidgetHost must already be created (because we can't know if it's
- // going to be a regular RenderWidgetHost or a RenderViewHost (a subclass).
- virtual RenderWidgetHostView* CreateViewForWidget(
- RenderWidgetHost* widget) = 0;
-
virtual TabContentsView* CreateTabContentsView(TabContents* tab_contents) = 0;
// Notifies that a new RenderHostView has been created.
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc
index ce76191..73e8a5c 100644
--- a/content/shell/shell_content_browser_client.cc
+++ b/content/shell/shell_content_browser_client.cc
@@ -13,7 +13,6 @@
#include "webkit/glue/webpreferences.h"
#if defined(OS_WIN)
-#include "content/browser/renderer_host/render_widget_host_view_win.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view_win.h"
#include "content/common/view_messages.h"
@@ -33,15 +32,6 @@ BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts(
return new ShellBrowserMainParts(parameters);
}
-RenderWidgetHostView* ShellContentBrowserClient::CreateViewForWidget(
- RenderWidgetHost* widget) {
-#if defined(OS_WIN)
- return new RenderWidgetHostViewWin(widget);
-#else
- return NULL;
-#endif
-}
-
TabContentsView* ShellContentBrowserClient::CreateTabContentsView(
TabContents* tab_contents) {
#if defined(OS_WIN)
diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h
index 383ebfd..44ee7c7 100644
--- a/content/shell/shell_content_browser_client.h
+++ b/content/shell/shell_content_browser_client.h
@@ -35,8 +35,6 @@ class ShellContentBrowserClient : public ContentBrowserClient
virtual BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) OVERRIDE;
- virtual RenderWidgetHostView* CreateViewForWidget(
- RenderWidgetHost* widget) OVERRIDE;
virtual TabContentsView* CreateTabContentsView(
TabContents* tab_contents) OVERRIDE;
virtual void RenderViewHostCreated(