summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authoravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 18:05:19 +0000
committeravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 18:05:19 +0000
commit47e4e1a0e7c75a188c7494643b8cc6258c405452 (patch)
tree2d1dcd5263f84c98663d4048c5211e762628e4ef /chrome/browser/tab_contents
parentcea3dfdedf95788f9973bcce16fc9446e898af9e (diff)
downloadchromium_src-47e4e1a0e7c75a188c7494643b8cc6258c405452.zip
chromium_src-47e4e1a0e7c75a188c7494643b8cc6258c405452.tar.gz
chromium_src-47e4e1a0e7c75a188c7494643b8cc6258c405452.tar.bz2
Enable child RWHVs on the Mac.
http://crbug.com/8824 Review URL: http://codereview.chromium.org/45040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/web_contents_view_mac.h4
-rw-r--r--chrome/browser/tab_contents/web_contents_view_mac.mm27
2 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/web_contents_view_mac.h b/chrome/browser/tab_contents/web_contents_view_mac.h
index 00ea654..4257274 100644
--- a/chrome/browser/tab_contents/web_contents_view_mac.h
+++ b/chrome/browser/tab_contents/web_contents_view_mac.h
@@ -65,6 +65,10 @@ class WebContentsViewMac : public WebContentsView,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture);
+ virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id,
+ bool activatable);
+ virtual void ShowCreatedWidgetInternal(RenderWidgetHostView* widget_host_view,
+ const gfx::Rect& initial_pos);
virtual void ShowContextMenu(const ContextMenuParams& params);
virtual void StartDragging(const WebDropData& drop_data);
virtual void UpdateDragCursor(bool is_drop_target);
diff --git a/chrome/browser/tab_contents/web_contents_view_mac.mm b/chrome/browser/tab_contents/web_contents_view_mac.mm
index d55af95..1cab6e6 100644
--- a/chrome/browser/tab_contents/web_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/web_contents_view_mac.mm
@@ -217,6 +217,33 @@ void WebContentsViewMac::ShowCreatedWindowInternal(
user_gesture);
}
+RenderWidgetHostView* WebContentsViewMac::CreateNewWidgetInternal(
+ int route_id,
+ bool activatable) {
+ // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it
+ // to allow it to survive the trip without being hosted.
+ RenderWidgetHostView* widget_view =
+ WebContentsView::CreateNewWidgetInternal(route_id, activatable);
+ RenderWidgetHostViewMac* widget_view_mac =
+ static_cast<RenderWidgetHostViewMac*>(widget_view);
+ [widget_view_mac->native_view() retain];
+
+ return widget_view;
+}
+
+void WebContentsViewMac::ShowCreatedWidgetInternal(
+ RenderWidgetHostView* widget_host_view,
+ const gfx::Rect& initial_pos) {
+ WebContentsView::ShowCreatedWidgetInternal(widget_host_view, initial_pos);
+
+ // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's
+ // properly embedded (or purposefully ignored) we can release the retain we
+ // took in CreateNewWidgetInternal().
+ RenderWidgetHostViewMac* widget_view_mac =
+ static_cast<RenderWidgetHostViewMac*>(widget_host_view);
+ [widget_view_mac->native_view() release];
+}
+
void WebContentsViewMac::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {