diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 15:12:57 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 15:12:57 +0000 |
commit | 5a3bdf5a67b78125b0e117aad5543cab1525a053 (patch) | |
tree | 98c89d326a458ccdc31295cfc703bbca21aedfb9 | |
parent | 39a6634645335f40dbcfdf2959b9170e4c79963e (diff) | |
download | chromium_src-5a3bdf5a67b78125b0e117aad5543cab1525a053.zip chromium_src-5a3bdf5a67b78125b0e117aad5543cab1525a053.tar.gz chromium_src-5a3bdf5a67b78125b0e117aad5543cab1525a053.tar.bz2 |
Move RenderViewHostDelegate::View to content/port and rename it to RenderViewHostDelegateView. This only needs to be seen by embedders who override WebContentsView. As a result, WebContentsView doesn't derive from it anymore.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/10441009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138799 0039d316-1c4b-4281-b951-d872f2087c98
37 files changed, 247 insertions, 159 deletions
diff --git a/ash/shell/content_client/shell_content_browser_client.cc b/ash/shell/content_client/shell_content_browser_client.cc index 36941f8..137e0a8 100644 --- a/ash/shell/content_client/shell_content_browser_client.cc +++ b/ash/shell/content_client/shell_content_browser_client.cc @@ -34,7 +34,8 @@ content::BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( content::WebContentsView* ShellContentBrowserClient::OverrideCreateWebContentsView( - content::WebContents* web_contents) { + content::WebContents* web_contents, + content::RenderViewHostDelegateView** render_view_host_delegate_view) { return NULL; } diff --git a/ash/shell/content_client/shell_content_browser_client.h b/ash/shell/content_client/shell_content_browser_client.h index ebbc2be..9506738 100644 --- a/ash/shell/content_client/shell_content_browser_client.h +++ b/ash/shell/content_client/shell_content_browser_client.h @@ -32,7 +32,9 @@ class ShellContentBrowserClient : public content::ContentBrowserClient { virtual content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual content::WebContentsView* OverrideCreateWebContentsView( - content::WebContents* web_contents) OVERRIDE; + content::WebContents* web_contents, + content::RenderViewHostDelegateView** render_view_host_delegate_view) + OVERRIDE; virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( content::WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index f90172c..92da01c 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -372,7 +372,8 @@ content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts( content::WebContentsView* ChromeContentBrowserClient::OverrideCreateWebContentsView( - WebContents* web_contents) { + WebContents* web_contents, + content::RenderViewHostDelegateView** render_view_host_delegate_view) { return NULL; } diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index d5615b4..247a7c2 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -28,7 +28,9 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual content::WebContentsView* OverrideCreateWebContentsView( - content::WebContents* web_contents) OVERRIDE; + content::WebContents* web_contents, + content::RenderViewHostDelegateView** render_view_host_delegate_view) + OVERRIDE; virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( content::WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc index d4b357b..512b930 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc @@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/debug/trace_event.h" #include "base/metrics/histogram.h" +#include "base/pickle.h" #include "base/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_node_data.h" diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index 037e424..312bee4 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -55,6 +55,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" +#include "content/public/browser/render_view_host_delegate.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_view.h" diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index bda51ff..666a692 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -27,8 +27,11 @@ BrowserMainParts* MockContentBrowserClient::CreateBrowserMainParts( } WebContentsView* MockContentBrowserClient::OverrideCreateWebContentsView( - WebContents* web_contents) { - return new TestWebContentsView; + WebContents* web_contents, + RenderViewHostDelegateView** render_view_host_delegate_view) { + TestWebContentsView* rv = new TestWebContentsView; + *render_view_host_delegate_view = rv; + return rv; } WebContentsViewDelegate* MockContentBrowserClient::GetWebContentsViewDelegate( diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index b9f4c80..472e932 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -24,7 +24,8 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual BrowserMainParts* CreateBrowserMainParts( const MainFunctionParams& parameters) OVERRIDE; virtual WebContentsView* OverrideCreateWebContentsView( - WebContents* web_contents) OVERRIDE; + WebContents* web_contents, + RenderViewHostDelegateView** render_view_host_delegate_view) OVERRIDE; virtual WebContentsViewDelegate* GetWebContentsViewDelegate( WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 1973210..b8f7d86 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -33,6 +33,7 @@ #include "content/common/speech_recognition_messages.h" #include "content/common/swapped_out_messages.h" #include "content/common/view_messages.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/port/browser/render_widget_host_view_port.h" #include "content/public/browser/browser_accessibility_state.h" #include "content/public/browser/browser_context.h" @@ -70,6 +71,7 @@ using base::TimeDelta; using content::NativeWebKeyboardEvent; +using content::RenderViewHostDelegateView; using WebKit::WebConsoleMessage; using WebKit::WebDragOperation; using WebKit::WebDragOperationNone; @@ -751,7 +753,7 @@ void RenderViewHostImpl::SetWebUIProperty(const std::string& name, void RenderViewHostImpl::GotFocus() { RenderWidgetHostImpl::GotFocus(); // Notifies the renderer it got focus. - RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); + RenderViewHostDelegateView* view = delegate_->GetDelegateView(); if (view) view->GotFocus(); } @@ -1315,7 +1317,7 @@ void RenderViewHostImpl::OnMsgStartDragging( WebDragOperationsMask drag_operations_mask, const SkBitmap& image, const gfx::Point& image_offset) { - RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); + RenderViewHostDelegateView* view = delegate_->GetDelegateView(); if (!view) return; @@ -1347,7 +1349,7 @@ void RenderViewHostImpl::OnMsgStartDragging( } void RenderViewHostImpl::OnUpdateDragCursor(WebDragOperation current_op) { - RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); + RenderViewHostDelegateView* view = delegate_->GetDelegateView(); if (view) view->UpdateDragCursor(current_op); } @@ -1360,7 +1362,7 @@ void RenderViewHostImpl::OnTargetDropACK() { } void RenderViewHostImpl::OnTakeFocus(bool reverse) { - RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); + RenderViewHostDelegateView* view = delegate_->GetDelegateView(); if (view) view->TakeFocus(reverse); } diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 793a793..d9840d9 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -8,6 +8,7 @@ #include "content/browser/web_contents/navigation_controller_impl.h" #include "content/browser/web_contents/test_web_contents.h" #include "content/common/view_messages.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/navigation_entry.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/page_transition_types.h" @@ -78,22 +79,9 @@ TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { } class MockDraggingRenderViewHostDelegateView - : public content::RenderViewHostDelegate::View { + : public content::RenderViewHostDelegateView { public: virtual ~MockDraggingRenderViewHostDelegateView() {} - virtual void CreateNewWindow( - int route_id, - const ViewHostMsg_CreateWindow_Params& params) {} - virtual void CreateNewWidget(int route_id, - WebKit::WebPopupType popup_type) {} - virtual void CreateNewFullscreenWidget(int route_id) {} - virtual void ShowCreatedWindow(int route_id, - WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, - bool user_gesture) {} - virtual void ShowCreatedWidget(int route_id, - const gfx::Rect& initial_pos) {} - virtual void ShowCreatedFullscreenWidget(int route_id) {} virtual void ShowContextMenu(const content::ContextMenuParams& params) {} virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask allowed_ops, @@ -122,37 +110,37 @@ class MockDraggingRenderViewHostDelegateView TEST_F(RenderViewHostTest, StartDragging) { TestWebContents* web_contents = contents(); - MockDraggingRenderViewHostDelegateView view_delegate; - web_contents->set_view_delegate(&view_delegate); + MockDraggingRenderViewHostDelegateView delegate_view; + web_contents->set_delegate_view(&delegate_view); WebDropData drop_data; GURL file_url = GURL("file:///home/user/secrets.txt"); drop_data.url = file_url; drop_data.html_base_url = file_url; test_rvh()->TestOnMsgStartDragging(drop_data); - EXPECT_EQ(GURL("about:blank"), view_delegate.drag_url()); - EXPECT_EQ(GURL("about:blank"), view_delegate.html_base_url()); + EXPECT_EQ(GURL("about:blank"), delegate_view.drag_url()); + EXPECT_EQ(GURL("about:blank"), delegate_view.html_base_url()); GURL http_url = GURL("http://www.domain.com/index.html"); drop_data.url = http_url; drop_data.html_base_url = http_url; test_rvh()->TestOnMsgStartDragging(drop_data); - EXPECT_EQ(http_url, view_delegate.drag_url()); - EXPECT_EQ(http_url, view_delegate.html_base_url()); + EXPECT_EQ(http_url, delegate_view.drag_url()); + EXPECT_EQ(http_url, delegate_view.html_base_url()); GURL https_url = GURL("https://www.domain.com/index.html"); drop_data.url = https_url; drop_data.html_base_url = https_url; test_rvh()->TestOnMsgStartDragging(drop_data); - EXPECT_EQ(https_url, view_delegate.drag_url()); - EXPECT_EQ(https_url, view_delegate.html_base_url()); + EXPECT_EQ(https_url, delegate_view.drag_url()); + EXPECT_EQ(https_url, delegate_view.html_base_url()); GURL javascript_url = GURL("javascript:alert('I am a bookmarklet')"); drop_data.url = javascript_url; drop_data.html_base_url = http_url; test_rvh()->TestOnMsgStartDragging(drop_data); - EXPECT_EQ(javascript_url, view_delegate.drag_url()); - EXPECT_EQ(http_url, view_delegate.html_base_url()); + EXPECT_EQ(javascript_url, delegate_view.drag_url()); + EXPECT_EQ(http_url, delegate_view.html_base_url()); } TEST_F(RenderViewHostTest, DragEnteredFileURLsStillBlocked) { diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc index ccafcad..41b307e 100644 --- a/content/browser/web_contents/interstitial_page_impl.cc +++ b/content/browser/web_contents/interstitial_page_impl.cc @@ -20,6 +20,7 @@ #include "content/browser/web_contents/navigation_entry_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/common/view_messages.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/port/browser/render_widget_host_view_port.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/dom_operation_notification_details.h" @@ -44,6 +45,7 @@ using content::NavigationEntryImpl; using content::RenderViewHost; using content::RenderViewHostImpl; using content::RenderViewHostDelegate; +using content::RenderViewHostDelegateView; using content::RenderWidgetHost; using content::RenderWidgetHostImpl; using content::RenderWidgetHostView; @@ -78,12 +80,12 @@ void ResourceRequestHelper(ResourceDispatcherHostImpl* rdh, } // namespace -class InterstitialPageImpl::InterstitialPageRVHViewDelegate - : public RenderViewHostDelegate::View { +class InterstitialPageImpl::InterstitialPageRVHDelegateView + : public content::RenderViewHostDelegateView { public: - explicit InterstitialPageRVHViewDelegate(InterstitialPageImpl* page); + explicit InterstitialPageRVHDelegateView(InterstitialPageImpl* page); - // RenderViewHostDelegate::View implementation: + // RenderViewHostDelegateView implementation: virtual void StartDragging(const WebDropData& drop_data, WebDragOperationsMask operations_allowed, const SkBitmap& image, @@ -100,7 +102,7 @@ class InterstitialPageImpl::InterstitialPageRVHViewDelegate private: InterstitialPageImpl* interstitial_page_; - DISALLOW_COPY_AND_ASSIGN(InterstitialPageRVHViewDelegate); + DISALLOW_COPY_AND_ASSIGN(InterstitialPageRVHDelegateView); }; @@ -155,8 +157,8 @@ InterstitialPageImpl::InterstitialPageImpl(WebContents* web_contents, should_revert_web_contents_title_(false), web_contents_was_loading_(false), resource_dispatcher_host_notified_(false), - ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( - new InterstitialPageRVHViewDelegate(this))), + ALLOW_THIS_IN_INITIALIZER_LIST(rvh_delegate_view_( + new InterstitialPageRVHDelegateView(this))), create_view_(true), delegate_(delegate) { InitInterstitialPageMap(); @@ -344,8 +346,8 @@ void InterstitialPageImpl::Observe( } } -RenderViewHostDelegate::View* InterstitialPageImpl::GetViewDelegate() { - return rvh_view_delegate_.get(); +RenderViewHostDelegateView* InterstitialPageImpl::GetDelegateView() { + return rvh_delegate_view_.get(); } const GURL& InterstitialPageImpl::GetURL() const { @@ -685,12 +687,12 @@ void InterstitialPageImpl::TakeActionOnResourceDispatcher( action)); } -InterstitialPageImpl::InterstitialPageRVHViewDelegate:: - InterstitialPageRVHViewDelegate(InterstitialPageImpl* page) +InterstitialPageImpl::InterstitialPageRVHDelegateView:: + InterstitialPageRVHDelegateView(InterstitialPageImpl* page) : interstitial_page_(page) { } -void InterstitialPageImpl::InterstitialPageRVHViewDelegate::StartDragging( +void InterstitialPageImpl::InterstitialPageRVHDelegateView::StartDragging( const WebDropData& drop_data, WebDragOperationsMask allowed_operations, const SkBitmap& image, @@ -698,27 +700,27 @@ void InterstitialPageImpl::InterstitialPageRVHViewDelegate::StartDragging( NOTREACHED() << "InterstitialPage does not support dragging yet."; } -void InterstitialPageImpl::InterstitialPageRVHViewDelegate::UpdateDragCursor( +void InterstitialPageImpl::InterstitialPageRVHDelegateView::UpdateDragCursor( WebDragOperation) { NOTREACHED() << "InterstitialPage does not support dragging yet."; } -void InterstitialPageImpl::InterstitialPageRVHViewDelegate::GotFocus() { +void InterstitialPageImpl::InterstitialPageRVHDelegateView::GotFocus() { } -void InterstitialPageImpl::InterstitialPageRVHViewDelegate::TakeFocus( +void InterstitialPageImpl::InterstitialPageRVHDelegateView::TakeFocus( bool reverse) { if (!interstitial_page_->web_contents()) return; WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(interstitial_page_->web_contents()); - if (!web_contents->GetViewDelegate()) + if (!web_contents->GetDelegateView()) return; - web_contents->GetViewDelegate()->TakeFocus(reverse); + web_contents->GetDelegateView()->TakeFocus(reverse); } -void InterstitialPageImpl::InterstitialPageRVHViewDelegate::OnFindReply( +void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) { } diff --git a/content/browser/web_contents/interstitial_page_impl.h b/content/browser/web_contents/interstitial_page_impl.h index edc2a9c..856ca1a 100644 --- a/content/browser/web_contents/interstitial_page_impl.h +++ b/content/browser/web_contents/interstitial_page_impl.h @@ -83,7 +83,7 @@ class CONTENT_EXPORT InterstitialPageImpl const content::NotificationDetails& details) OVERRIDE; // RenderViewHostDelegate implementation: - virtual View* GetViewDelegate() OVERRIDE; + virtual content::RenderViewHostDelegateView* GetDelegateView() OVERRIDE; virtual const GURL& GetURL() const OVERRIDE; virtual void RenderViewGone(content::RenderViewHost* render_view_host, base::TerminationStatus status, @@ -138,7 +138,7 @@ class CONTENT_EXPORT InterstitialPageImpl content::NotificationRegistrar notification_registrar_; private: - class InterstitialPageRVHViewDelegate; + class InterstitialPageRVHDelegateView; // Disable the interstitial: // - if it is not yet showing, then it won't be shown. @@ -202,7 +202,7 @@ class CONTENT_EXPORT InterstitialPageImpl string16 original_web_contents_title_; // Our RenderViewHostViewDelegate, necessary for accelerators to work. - scoped_ptr<InterstitialPageRVHViewDelegate> rvh_view_delegate_; + scoped_ptr<InterstitialPageRVHDelegateView> rvh_delegate_view_; // Settings passed to the renderer. mutable content::RendererPreferences renderer_preferences_; diff --git a/content/browser/web_contents/test_web_contents.cc b/content/browser/web_contents/test_web_contents.cc index 3ca74dbe..8cf5746 100644 --- a/content/browser/web_contents/test_web_contents.cc +++ b/content/browser/web_contents/test_web_contents.cc @@ -158,10 +158,10 @@ void TestWebContents::ProceedWithCrossSiteNavigation() { rvh->SendShouldCloseACK(true); } -RenderViewHostDelegate::View* TestWebContents::GetViewDelegate() { +RenderViewHostDelegateView* TestWebContents::GetDelegateView() { if (delegate_view_override_) return delegate_view_override_; - return WebContentsImpl::GetViewDelegate(); + return WebContentsImpl::GetDelegateView(); } void TestWebContents::SetOpener(TestWebContents* opener) { diff --git a/content/browser/web_contents/test_web_contents.h b/content/browser/web_contents/test_web_contents.h index 7ca05b9..b3c5aa6 100644 --- a/content/browser/web_contents/test_web_contents.h +++ b/content/browser/web_contents/test_web_contents.h @@ -67,9 +67,9 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { // Set by individual tests. bool transition_cross_site; - // Allow mocking of the RenderViewHostDelegate::View. - virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; - void set_view_delegate(RenderViewHostDelegate::View* view) { + // Allow mocking of the RenderViewHostDelegateView. + virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; + void set_delegate_view(RenderViewHostDelegateView* view) { delegate_view_override_ = view; } @@ -106,7 +106,7 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; - RenderViewHostDelegate::View* delegate_view_override_; + RenderViewHostDelegateView* delegate_view_override_; // Expectations for arguments of |SetHistoryLengthAndPrune()|. bool expect_set_history_length_and_prune_; diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 7a47af5..2203b11 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -37,6 +37,7 @@ #include "content/common/intents_messages.h" #include "content/common/ssl_status_serialization.h" #include "content/common/view_messages.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/port/browser/render_widget_host_view_port.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/color_chooser.h" @@ -136,6 +137,7 @@ using content::NavigationEntryImpl; using content::OpenURLParams; using content::RenderViewHost; using content::RenderViewHostDelegate; +using content::RenderViewHostDelegateView; using content::RenderViewHostImpl; using content::RenderWidgetHost; using content::RenderWidgetHostImpl; @@ -274,6 +276,7 @@ WebContentsImpl::WebContentsImpl( : delegate_(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(controller_( this, browser_context, session_storage_namespace)), + render_view_host_delegate_view_(NULL), opener_(opener), ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this, this)), is_loading_(false), @@ -304,12 +307,16 @@ WebContentsImpl::WebContentsImpl( render_manager_.Init(browser_context, site_instance, routing_id); view_.reset(content::GetContentClient()->browser()-> - OverrideCreateWebContentsView(this)); - if (!view_.get()) { + OverrideCreateWebContentsView(this, &render_view_host_delegate_view_)); + if (view_.get()) { + CHECK(render_view_host_delegate_view_); + } else { content::WebContentsViewDelegate* delegate = content::GetContentClient()->browser()->GetWebContentsViewDelegate( this); - view_.reset(CreateWebContentsView(this, delegate)); + view_.reset(CreateWebContentsView( + this, delegate, &render_view_host_delegate_view_)); + CHECK(render_view_host_delegate_view_); } CHECK(view_.get()); @@ -1287,7 +1294,7 @@ void WebContentsImpl::ShowContextMenu( if (delegate_ && delegate_->HandleContextMenu(params)) return; - view_->ShowContextMenu(params); + render_view_host_delegate_view_->ShowContextMenu(params); } void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { @@ -2272,8 +2279,8 @@ void WebContentsImpl::NotifyDisconnected() { content::NotificationService::NoDetails()); } -RenderViewHostDelegate::View* WebContentsImpl::GetViewDelegate() { - return view_.get(); +RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() { + return render_view_host_delegate_view_; } RenderViewHostDelegate::RendererManagement* diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index a689817..20ec899 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -44,6 +44,7 @@ class ColorChooser; class DownloadItem; class JavaScriptDialogCreator; class RenderViewHost; +class RenderViewHostDelegateView; class RenderViewHostImpl; class SiteInstance; class TestWebContents; @@ -55,8 +56,10 @@ struct LoadNotificationDetails; // Factory function for the implementations that content knows about. Takes // ownership of |delegate|. -WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, - WebContentsViewDelegate* delegate); +WebContentsView* CreateWebContentsView( + WebContentsImpl* web_contents, + WebContentsViewDelegate* delegate, + RenderViewHostDelegateView** render_view_host_delegate_view); } namespace webkit_glue { @@ -255,7 +258,7 @@ class CONTENT_EXPORT WebContentsImpl // RenderViewHostDelegate ---------------------------------------------------- - virtual content::RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; + virtual content::RenderViewHostDelegateView* GetDelegateView() OVERRIDE; virtual content::RenderViewHostDelegate::RendererManagement* GetRendererManagementDelegate() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; @@ -624,6 +627,11 @@ class CONTENT_EXPORT WebContentsImpl // The corresponding view. scoped_ptr<content::WebContentsView> view_; + // The view of the RVHD. Usually this is our WebContentsView implementation, + // but if an embedder uses a different WebContentsView, they'll need to + // provide this. + content::RenderViewHostDelegateView* render_view_host_delegate_view_; + // Tracks created WebContentsImpl objects that have not been shown yet. They // are identified by the route ID passed to CreateNewWindow. typedef std::map<int, WebContentsImpl*> PendingContents; diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc index 1c8ae59..6a74db5 100644 --- a/content/browser/web_contents/web_contents_view_android.cc +++ b/content/browser/web_contents/web_contents_view_android.cc @@ -9,9 +9,13 @@ #include "content/browser/web_contents/web_contents_impl.h" namespace content { -WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, - WebContentsViewDelegate* delegate) { - return new WebContentsViewAndroid(web_contents); +WebContentsView* CreateWebContentsView( + WebContentsImpl* web_contents, + WebContentsViewDelegate* delegate, + RenderViewHostDelegateView** render_view_host_delegate_view) { + WebContentsViewAndroid* rv = new WebContentsViewAndroid(web_contents); + *render_view_host_delegate_view = rv; + return rv; } } diff --git a/content/browser/web_contents/web_contents_view_android.h b/content/browser/web_contents/web_contents_view_android.h index 3ad4109..3798d32 100644 --- a/content/browser/web_contents/web_contents_view_android.h +++ b/content/browser/web_contents/web_contents_view_android.h @@ -6,9 +6,16 @@ #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ #pragma once +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/web_contents_view.h" -class WebContentsViewAndroid : public content::WebContentsView { +namespace content { +class WebContents; +} + +class WebContentsViewAndroid + : public content::WebContentsView, + public content::RenderViewHostDelegateView { public: explicit WebContentsViewAndroid(content::WebContents* web_contents); virtual ~WebContentsViewAndroid(); @@ -39,7 +46,7 @@ class WebContentsViewAndroid : public content::WebContentsView { virtual void CloseTabAfterEventTracking() OVERRIDE; virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; - // Backend implementation of RenderViewHostDelegate::View. + // Backend implementation of RenderViewHostDelegateView. virtual void ShowContextMenu( const content::ContextMenuParams& params) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index d64755a..2845cff 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -30,9 +30,13 @@ #include "webkit/glue/webdropdata.h" namespace content { -WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, - WebContentsViewDelegate* delegate) { - return new WebContentsViewAura(web_contents, delegate); +WebContentsView* CreateWebContentsView( + WebContentsImpl* web_contents, + WebContentsViewDelegate* delegate, + RenderViewHostDelegateView** render_view_host_delegate_view) { + WebContentsViewAura* rv = new WebContentsViewAura(web_contents, delegate); + *render_view_host_delegate_view = rv; + return rv; } } @@ -390,7 +394,7 @@ void WebContentsViewAura::GetViewBounds(gfx::Rect* out) const { } //////////////////////////////////////////////////////////////////////////////// -// WebContentsViewAura, RenderViewHostDelegate::View implementation: +// WebContentsViewAura, RenderViewHostDelegateView implementation: void WebContentsViewAura::ShowContextMenu( const content::ContextMenuParams& params) { diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index ea32e32..1b307af 100644 --- a/content/browser/web_contents/web_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h @@ -9,10 +9,13 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/web_contents_view.h" #include "ui/aura/client/drag_drop_delegate.h" #include "ui/aura/window_delegate.h" +class WebContentsImpl; + namespace aura { class Window; } @@ -24,6 +27,7 @@ class WebDragDestDelegate; class CONTENT_EXPORT WebContentsViewAura : public content::WebContentsView, + public content::RenderViewHostDelegateView, public aura::WindowDelegate, public aura::client::DragDropDelegate { public: @@ -60,7 +64,7 @@ class CONTENT_EXPORT WebContentsViewAura virtual void CloseTabAfterEventTracking() OVERRIDE; virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; - // Overridden from RenderViewHostDelegate::View: + // Overridden from RenderViewHostDelegateView: virtual void ShowContextMenu( const content::ContextMenuParams& params) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, diff --git a/content/browser/web_contents/web_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc index d4f3587..d118130 100644 --- a/content/browser/web_contents/web_contents_view_gtk.cc +++ b/content/browser/web_contents/web_contents_view_gtk.cc @@ -78,9 +78,13 @@ gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, namespace content { -WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, - WebContentsViewDelegate* delegate) { - return new WebContentsViewGtk(web_contents, delegate); +WebContentsView* CreateWebContentsView( + WebContentsImpl* web_contents, + WebContentsViewDelegate* delegate, + RenderViewHostDelegateView** render_view_host_delegate_view) { + WebContentsViewGtk* rv = new WebContentsViewGtk(web_contents, delegate); + *render_view_host_delegate_view = rv; + return rv; } WebContentsViewGtk::WebContentsViewGtk( diff --git a/content/browser/web_contents/web_contents_view_gtk.h b/content/browser/web_contents/web_contents_view_gtk.h index 61c371a..a41053a 100644 --- a/content/browser/web_contents/web_contents_view_gtk.h +++ b/content/browser/web_contents/web_contents_view_gtk.h @@ -12,19 +12,25 @@ #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/web_contents_view.h" #include "ui/base/gtk/focus_store_gtk.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/gtk/owned_widget_gtk.h" +class WebContentsImpl; + namespace content { +class WebContents; class WebContentsViewDelegate; class WebDragDestDelegate; class WebDragDestGtk; class WebDragSourceGtk; -class CONTENT_EXPORT WebContentsViewGtk : public WebContentsView { +class CONTENT_EXPORT WebContentsViewGtk + : public WebContentsView, + public RenderViewHostDelegateView { public: // The corresponding WebContentsImpl is passed in the constructor, and manages // our lifetime. This doesn't need to be the case, but is this way currently @@ -64,7 +70,7 @@ class CONTENT_EXPORT WebContentsViewGtk : public WebContentsView { virtual void CloseTabAfterEventTracking() OVERRIDE; virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; - // Backend implementation of RenderViewHostDelegate::View. + // Backend implementation of RenderViewHostDelegateView. virtual void ShowContextMenu( const content::ContextMenuParams& params) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, diff --git a/content/browser/web_contents/web_contents_view_mac.h b/content/browser/web_contents/web_contents_view_mac.h index b44e649..eb9f049 100644 --- a/content/browser/web_contents/web_contents_view_mac.h +++ b/content/browser/web_contents/web_contents_view_mac.h @@ -13,12 +13,14 @@ #include "base/memory/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/web_contents_view.h" #include "ui/base/cocoa/base_view.h" #include "ui/gfx/size.h" @class FocusTracker; class SkBitmap; +class WebContentsImpl; class WebContentsViewMac; @class WebDragDest; @class WebDragSource; @@ -45,7 +47,9 @@ class Point; // Mac-specific implementation of the WebContentsView. It owns an NSView that // contains all of the contents of the tab and associated child views. -class WebContentsViewMac : public content::WebContentsView { +class WebContentsViewMac + : public content::WebContentsView, + public content::RenderViewHostDelegateView { public: // The corresponding WebContentsImpl is passed in the constructor, and manages // our lifetime. This doesn't need to be the case, but is this way currently @@ -79,7 +83,7 @@ class WebContentsViewMac : public content::WebContentsView { virtual void CloseTabAfterEventTracking() OVERRIDE; virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; - // Backend implementation of RenderViewHostDelegate::View. + // Backend implementation of RenderViewHostDelegateView. virtual void ShowContextMenu( const content::ContextMenuParams& params) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm index e4c84b6..b03012f 100644 --- a/content/browser/web_contents/web_contents_view_mac.mm +++ b/content/browser/web_contents/web_contents_view_mac.mm @@ -57,9 +57,13 @@ COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); @end namespace content { -WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, - WebContentsViewDelegate* delegate) { - return new WebContentsViewMac(web_contents, delegate); +WebContentsView* CreateWebContentsView( + WebContentsImpl* web_contents, + WebContentsViewDelegate* delegate, + RenderViewHostDelegateView** render_view_host_delegate_view) { + WebContentsViewMac* rv = new WebContentsViewMac(web_contents, delegate); + *render_view_host_delegate_view = rv; + return rv; } } diff --git a/content/browser/web_contents/web_contents_view_win.cc b/content/browser/web_contents/web_contents_view_win.cc index 823dd7b..b24079e 100644 --- a/content/browser/web_contents/web_contents_view_win.cc +++ b/content/browser/web_contents/web_contents_view_win.cc @@ -22,9 +22,13 @@ using content::WebContents; using content::WebContentsViewDelegate; namespace content { -WebContentsView* CreateWebContentsView(WebContentsImpl* web_contents, - WebContentsViewDelegate* delegate) { - return new WebContentsViewWin(web_contents, delegate); +WebContentsView* CreateWebContentsView( + WebContentsImpl* web_contents, + WebContentsViewDelegate* delegate, + RenderViewHostDelegateView** render_view_host_delegate_view) { + WebContentsViewWin* rv = new WebContentsViewWin(web_contents, delegate); + *render_view_host_delegate_view = rv; + return rv; } } diff --git a/content/browser/web_contents/web_contents_view_win.h b/content/browser/web_contents/web_contents_view_win.h index 43ea5d2..0f6f244 100644 --- a/content/browser/web_contents/web_contents_view_win.h +++ b/content/browser/web_contents/web_contents_view_win.h @@ -11,19 +11,23 @@ #include "base/timer.h" #include "base/win/win_util.h" #include "content/common/content_export.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/web_contents_view.h" #include "ui/base/win/window_impl.h" class RenderWidgetHostViewWin; class WebDragDest; class WebContentsDragWin; +class WebContentsImpl; namespace content { class WebContentsViewDelegate; } // An implementation of WebContentsView for Windows. -class CONTENT_EXPORT WebContentsViewWin : public content::WebContentsView, +class CONTENT_EXPORT WebContentsViewWin + : public content::WebContentsView, + public content::RenderViewHostDelegateView, public ui::WindowImpl { public: WebContentsViewWin(WebContentsImpl* web_contents, @@ -70,7 +74,7 @@ class CONTENT_EXPORT WebContentsViewWin : public content::WebContentsView, virtual void CloseTabAfterEventTracking() OVERRIDE; virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; - // Implementation of RenderViewHostDelegate::View. + // Implementation of RenderViewHostDelegateView. virtual void ShowContextMenu( const content::ContextMenuParams& params) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 4221c3b..2ceca05 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -28,6 +28,7 @@ '<(INTERMEDIATE_DIR)', ], 'sources': [ + 'port/browser/render_view_host_delegate_view.h', 'port/browser/render_widget_host_view_port.h', 'public/browser/access_token_store.h', 'public/browser/android_library_loader_hooks.h', diff --git a/content/port/browser/render_view_host_delegate_view.h b/content/port/browser/render_view_host_delegate_view.h new file mode 100644 index 0000000..c04603a --- /dev/null +++ b/content/port/browser/render_view_host_delegate_view.h @@ -0,0 +1,59 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ +#define CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ +#pragma once + +#include "base/basictypes.h" +#include "content/common/content_export.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" + +class SkBitmap; +struct WebDropData; + +namespace gfx { +class Point; +} + +namespace content { + +struct ContextMenuParams; + +// This class provides a way for the RenderViewHost to reach out to its +// delegate's view. It only needs to be implemented by embedders if they don't +// use the default WebContentsView implementations. +class CONTENT_EXPORT RenderViewHostDelegateView { + public: + // A context menu should be shown, to be built using the context information + // provided in the supplied params. + virtual void ShowContextMenu(const ContextMenuParams& params) {} + + // The user started dragging content of the specified type within the + // RenderView. Contextual information about the dragged content is supplied + // by WebDropData. + virtual void StartDragging(const WebDropData& drop_data, + WebKit::WebDragOperationsMask allowed_ops, + const SkBitmap& image, + const gfx::Point& image_offset) {} + + // The page wants to update the mouse cursor during a drag & drop operation. + // |operation| describes the current operation (none, move, copy, link.) + virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} + + // Notification that view for this delegate got the focus. + virtual void GotFocus() {} + + // Callback to inform the browser that the page is returning the focus to + // the browser's chrome. If reverse is true, it means the focus was + // retrieved by doing a Shift-Tab. + virtual void TakeFocus(bool reverse) {} + + protected: + virtual ~RenderViewHostDelegateView() {} +}; + +} // namespace content + +#endif // CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 8ae2dc6..c2debb2 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -27,19 +27,6 @@ namespace webkit_glue { struct WebPreferences; } -namespace content { -class AccessTokenStore; -class BrowserMainParts; -class BrowserURLHandler; -class RenderProcessHost; -class SiteInstance; -class SpeechRecognitionManagerDelegate; -class WebContents; -class WebContentsView; -struct MainFunctionParams; -struct ShowDesktopNotificationHostMsgParams; -} - namespace crypto { class CryptoModuleBlockingPasswordDelegate; } @@ -66,13 +53,16 @@ class AccessTokenStore; class BrowserChildProcessHost; class BrowserContext; class BrowserMainParts; +class BrowserURLHandler; class MediaObserver; class QuotaPermissionContext; class RenderProcessHost; class RenderViewHost; +class RenderViewHostDelegateView; class ResourceContext; class SiteInstance; class SpeechInputManagerDelegate; +class SpeechRecognitionManagerDelegate; class WebContents; class WebContentsView; class WebContentsViewDelegate; @@ -101,9 +91,12 @@ class ContentBrowserClient { const MainFunctionParams& parameters) = 0; // Allows an embedder to return their own WebContentsView implementation. - // Return NULL to let the default one for the platform be created. + // Return NULL to let the default one for the platform be created. Otherwise + // |render_view_host_delegate_view| also needs to be provided, and it is + // owned by the embedder. virtual WebContentsView* OverrideCreateWebContentsView( - WebContents* web_contents) = 0; + WebContents* web_contents, + RenderViewHostDelegateView** render_view_host_delegate_view) = 0; // If content creates the WebContentsView implementation, it will ask the // embedder to return an (optional) delegate to customize it. The view will diff --git a/content/public/browser/render_view_host_delegate.cc b/content/public/browser/render_view_host_delegate.cc index a056a70..8f25513 100644 --- a/content/public/browser/render_view_host_delegate.cc +++ b/content/public/browser/render_view_host_delegate.cc @@ -9,7 +9,7 @@ namespace content { -RenderViewHostDelegate::View* RenderViewHostDelegate::GetViewDelegate() { +RenderViewHostDelegateView* RenderViewHostDelegate::GetDelegateView() { return NULL; } diff --git a/content/public/browser/render_view_host_delegate.h b/content/public/browser/render_view_host_delegate.h index b573086..e93b055 100644 --- a/content/public/browser/render_view_host_delegate.h +++ b/content/public/browser/render_view_host_delegate.h @@ -15,7 +15,6 @@ #include "content/common/content_export.h" #include "ipc/ipc_channel.h" #include "net/base/load_states.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" #include "ui/base/javascript_message_type.h" #include "webkit/glue/window_open_disposition.h" @@ -28,7 +27,6 @@ struct ViewHostMsg_CreateWindow_Params; struct ViewHostMsg_DidFailProvisionalLoadWithError_Params; struct ViewHostMsg_FrameNavigate_Params; struct ViewMsg_PostMessage_Params; -struct WebDropData; namespace webkit_glue { struct WebPreferences; @@ -49,6 +47,7 @@ namespace content { class BrowserContext; class RenderViewHost; +class RenderViewHostDelegateView; class WebContents; struct ContextMenuParams; struct FileChooserParams; @@ -72,38 +71,6 @@ struct RendererPreferences; // TODO(joi): See if we can hide most or all of this from chrome/. class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Channel::Listener { public: - // View ---------------------------------------------------------------------- - // Functions that can be routed directly to a view-specific class. - class CONTENT_EXPORT View { - public: - // A context menu should be shown, to be built using the context information - // provided in the supplied params. - virtual void ShowContextMenu(const content::ContextMenuParams& params) {} - - // The user started dragging content of the specified type within the - // RenderView. Contextual information about the dragged content is supplied - // by WebDropData. - virtual void StartDragging(const WebDropData& drop_data, - WebKit::WebDragOperationsMask allowed_ops, - const SkBitmap& image, - const gfx::Point& image_offset) {} - - // The page wants to update the mouse cursor during a drag & drop operation. - // |operation| describes the current operation (none, move, copy, link.) - virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} - - // Notification that view for this delegate got the focus. - virtual void GotFocus() {} - - // Callback to inform the browser that the page is returning the focus to - // the browser's chrome. If reverse is true, it means the focus was - // retrieved by doing a Shift-Tab. - virtual void TakeFocus(bool reverse) {} - - protected: - virtual ~View() {} - }; - // RendererManagerment ------------------------------------------------------- // Functions for managing switching of Renderers. For WebContents, this is // implemented by the RenderViewHostManager. @@ -135,7 +102,7 @@ class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Channel::Listener { // Returns the current delegate associated with a feature. May return NULL if // there is no corresponding delegate. - virtual View* GetViewDelegate(); + virtual RenderViewHostDelegateView* GetDelegateView(); virtual RendererManagement* GetRendererManagementDelegate(); // IPC::Channel::Listener implementation. diff --git a/content/public/browser/web_contents_view.h b/content/public/browser/web_contents_view.h index 2d2394f..bf2c463 100644 --- a/content/public/browser/web_contents_view.h +++ b/content/public/browser/web_contents_view.h @@ -9,8 +9,8 @@ #include <string> #include "base/basictypes.h" +#include "base/process_util.h" #include "content/common/content_export.h" -#include "content/public/browser/render_view_host_delegate.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -25,12 +25,9 @@ class RenderWidgetHostView; // The WebContentsView is an interface that is implemented by the platform- // dependent web contents views. The WebContents uses this interface to talk to -// them. View-related messages will also get forwarded directly to this class -// from RenderViewHost via RenderViewHostDelegate::View. -class CONTENT_EXPORT WebContentsView - : public content::RenderViewHostDelegate::View { +// them. +class CONTENT_EXPORT WebContentsView { public: - WebContentsView() {} virtual ~WebContentsView() {} virtual void CreateView(const gfx::Size& initial_size) = 0; diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index 93e66e1..012a0eb 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -32,7 +32,8 @@ BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( } WebContentsView* ShellContentBrowserClient::OverrideCreateWebContentsView( - WebContents* web_contents) { + WebContents* web_contents, + RenderViewHostDelegateView** render_view_host_delegate_view) { return NULL; } diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index ecd62ba..7fe5a69 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -27,7 +27,8 @@ class ShellContentBrowserClient : public ContentBrowserClient { virtual BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual WebContentsView* OverrideCreateWebContentsView( - WebContents* web_contents) OVERRIDE; + WebContents* web_contents, + RenderViewHostDelegateView** render_view_host_delegate_view) OVERRIDE; virtual WebContentsViewDelegate* GetWebContentsViewDelegate( WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( diff --git a/content/test/test_web_contents_view.h b/content/test/test_web_contents_view.h index 6aa5cf1..ad72fe2 100644 --- a/content/test/test_web_contents_view.h +++ b/content/test/test_web_contents_view.h @@ -7,16 +7,18 @@ #pragma once #include "base/compiler_specific.h" +#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/web_contents_view.h" namespace content { -class TestWebContentsView : public WebContentsView { +class TestWebContentsView : public WebContentsView, + public RenderViewHostDelegateView { public: TestWebContentsView(); virtual ~TestWebContentsView(); - // RenderViewHostDelegate::View: + // RenderViewHostDelegateView: virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask allowed_ops, diff --git a/ui/views/examples/content_client/examples_content_browser_client.cc b/ui/views/examples/content_client/examples_content_browser_client.cc index 291ed7c..d046a66 100644 --- a/ui/views/examples/content_client/examples_content_browser_client.cc +++ b/ui/views/examples/content_client/examples_content_browser_client.cc @@ -34,7 +34,8 @@ content::BrowserMainParts* ExamplesContentBrowserClient::CreateBrowserMainParts( content::WebContentsView* ExamplesContentBrowserClient::OverrideCreateWebContentsView( - content::WebContents* web_contents) { + content::WebContents* web_contents, + content::RenderViewHostDelegateView** render_view_host_delegate_view) { return NULL; } diff --git a/ui/views/examples/content_client/examples_content_browser_client.h b/ui/views/examples/content_client/examples_content_browser_client.h index ad13bd6..e5a082a 100644 --- a/ui/views/examples/content_client/examples_content_browser_client.h +++ b/ui/views/examples/content_client/examples_content_browser_client.h @@ -32,7 +32,9 @@ class ExamplesContentBrowserClient : public content::ContentBrowserClient { virtual content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual content::WebContentsView* OverrideCreateWebContentsView( - content::WebContents* web_contents) OVERRIDE; + content::WebContents* web_contents, + content::RenderViewHostDelegateView** render_view_host_delegate_view) + OVERRIDE; virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( content::WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( |