Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 388803003: [Mac] Replace SetOverlayView with AllowOtherViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, fixed comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 39e579baec2e64258a39bf4110eb15ffda57f3d5..48d3cca1f447090e362f2608bd11f5faf7ada872 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -82,8 +82,7 @@ WebContentsViewMac::WebContentsViewMac(WebContentsImpl* web_contents,
: web_contents_(web_contents),
delegate_(delegate),
allow_overlapping_views_(false),
- overlay_view_(NULL),
- underlay_view_(NULL) {
+ allow_other_views_(false) {
}
WebContentsViewMac::~WebContentsViewMac() {
@@ -278,52 +277,19 @@ bool WebContentsViewMac::GetAllowOverlappingViews() const {
return allow_overlapping_views_;
}
-void WebContentsViewMac::SetOverlayView(
- WebContentsView* overlay, const gfx::Point& offset) {
- DCHECK(!underlay_view_);
- if (overlay_view_)
- RemoveOverlayView();
-
- overlay_view_ = static_cast<WebContentsViewMac*>(overlay);
- DCHECK(!overlay_view_->overlay_view_);
- overlay_view_->underlay_view_ = this;
- overlay_view_offset_ = offset;
- UpdateRenderWidgetHostViewOverlay();
-}
-
-void WebContentsViewMac::RemoveOverlayView() {
- DCHECK(overlay_view_);
+void WebContentsViewMac::SetAllowOtherViews(bool allow) {
+ if (allow_other_views_ == allow)
+ return;
- RenderWidgetHostViewMac* rwhv = static_cast<RenderWidgetHostViewMac*>(
+ allow_other_views_ = allow;
+ RenderWidgetHostViewMac* view = static_cast<RenderWidgetHostViewMac*>(
web_contents_->GetRenderWidgetHostView());
- if (rwhv)
- rwhv->RemoveOverlayView();
-
- overlay_view_->underlay_view_ = NULL;
- overlay_view_ = NULL;
+ if (view)
+ view->SetAllowPauseForResizeOrRepaint(!allow_other_views_);
}
-void WebContentsViewMac::UpdateRenderWidgetHostViewOverlay() {
- RenderWidgetHostViewMac* rwhv = static_cast<RenderWidgetHostViewMac*>(
- web_contents_->GetRenderWidgetHostView());
- if (!rwhv)
- return;
-
- if (overlay_view_) {
- RenderWidgetHostViewMac* overlay_rwhv =
- static_cast<RenderWidgetHostViewMac*>(
- overlay_view_->web_contents_->GetRenderWidgetHostView());
- if (overlay_rwhv)
- rwhv->SetOverlayView(overlay_rwhv, overlay_view_offset_);
- }
-
- if (underlay_view_) {
- RenderWidgetHostViewMac* underlay_rwhv =
- static_cast<RenderWidgetHostViewMac*>(
- underlay_view_->web_contents_->GetRenderWidgetHostView());
- if (underlay_rwhv)
- underlay_rwhv->SetOverlayView(rwhv, underlay_view_->overlay_view_offset_);
- }
+bool WebContentsViewMac::GetAllowOtherViews() const {
+ return allow_other_views_;
}
void WebContentsViewMac::CreateView(
@@ -356,6 +322,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
view->SetDelegate(rw_delegate.get());
}
view->SetAllowOverlappingViews(allow_overlapping_views_);
+ view->SetAllowPauseForResizeOrRepaint(!allow_other_views_);
// Fancy layout comes later; for now just make it our size and resize it
// with us. In case there are other siblings of the content area, we want
@@ -397,7 +364,6 @@ void WebContentsViewMac::RenderViewCreated(RenderViewHost* host) {
}
void WebContentsViewMac::RenderViewSwappedIn(RenderViewHost* host) {
- UpdateRenderWidgetHostViewOverlay();
}
void WebContentsViewMac::SetOverscrollControllerEnabled(bool enabled) {
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698