summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 19:15:08 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 19:15:08 +0000
commit7adee63b8cac7f5a9c3127b5a0a5ec27a644acf3 (patch)
tree5308b900330eee4d849b065a22863c0fea933dda
parent8c803bdb816f7298de075b9765312d333f8f61c5 (diff)
downloadchromium_src-7adee63b8cac7f5a9c3127b5a0a5ec27a644acf3.zip
chromium_src-7adee63b8cac7f5a9c3127b5a0a5ec27a644acf3.tar.gz
chromium_src-7adee63b8cac7f5a9c3127b5a0a5ec27a644acf3.tar.bz2
Clip constrained windows to the tabcontents bounds.
There may be a way to add this at a lower level (i.e. in ui/aura) but that seems somewhat risky. I haven't come up with the good generic rule yet. http://crbug.com/108753 TEST=none Review URL: https://chromiumcodereview.appspot.com/9703068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126964 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc2
-rw-r--r--ui/gfx/compositor/layer.cc8
-rw-r--r--ui/gfx/compositor/layer.h5
3 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
index dd1c65f..adca553 100644
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
+++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc
@@ -21,6 +21,7 @@
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_aura.h"
+#include "ui/gfx/compositor/layer.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
#include "webkit/glue/webdropdata.h"
@@ -163,6 +164,7 @@ void NativeTabContentsViewAura::InitNativeTabContentsView() {
params.parent = NULL;
params.can_activate = true;
GetWidget()->Init(params);
+ GetNativeView()->layer()->SetMasksToBounds(true);
GetNativeWindow()->SetName("NativeTabContentsViewAura");
#if defined(USE_ASH)
ash::SetChildWindowVisibilityChangesAnimated(GetWidget()->GetNativeView());
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
index fe5d161..c865a12 100644
--- a/ui/gfx/compositor/layer.cc
+++ b/ui/gfx/compositor/layer.cc
@@ -171,6 +171,14 @@ gfx::Rect Layer::GetTargetBounds() const {
return bounds_;
}
+void Layer::SetMasksToBounds(bool masks_to_bounds) {
+ web_layer_.setMasksToBounds(masks_to_bounds);
+}
+
+bool Layer::GetMasksToBounds() const {
+ return web_layer_.masksToBounds();
+}
+
void Layer::SetOpacity(float opacity) {
GetAnimator()->SetOpacity(opacity);
}
diff --git a/ui/gfx/compositor/layer.h b/ui/gfx/compositor/layer.h
index e5c4134..c03b28b 100644
--- a/ui/gfx/compositor/layer.h
+++ b/ui/gfx/compositor/layer.h
@@ -128,6 +128,11 @@ class COMPOSITOR_EXPORT Layer :
// otherwise.
gfx::Rect GetTargetBounds() const;
+ // Sets/gets whether or not drawing of child layers should be clipped to the
+ // bounds of this layer.
+ void SetMasksToBounds(bool masks_to_bounds);
+ bool GetMasksToBounds() const;
+
// The opacity of the layer. The opacity is applied to each pixel of the
// texture (resulting alpha = opacity * alpha).
float opacity() const { return opacity_; }