summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 16:55:24 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 16:55:24 +0000
commit5e4e61f45c2960389b6eeb6bcb061602048ec2db (patch)
tree313a8a75169fcae75d4e2206ada71a3d5807cf75 /ui/gfx
parent6f682af251936a5b666a69015a746b27a617aac6 (diff)
downloadchromium_src-5e4e61f45c2960389b6eeb6bcb061602048ec2db.zip
chromium_src-5e4e61f45c2960389b6eeb6bcb061602048ec2db.tar.gz
chromium_src-5e4e61f45c2960389b6eeb6bcb061602048ec2db.tar.bz2
s/Move/Stack/ in names of stacking-related methods.
This renames methods in aura::Window, views::Widget, and gfx::Layer. "MoveAbove" becomes "StackAbove" and "MoveToFront" becomes "StackAtTop". BUG=none TEST=built it Review URL: http://codereview.chromium.org/8620002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/compositor/layer.cc6
-rw-r--r--ui/gfx/compositor/layer.h10
-rw-r--r--ui/gfx/compositor/layer_unittest.cc8
3 files changed, 12 insertions, 12 deletions
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
index 109771ef..26e2699 100644
--- a/ui/gfx/compositor/layer.cc
+++ b/ui/gfx/compositor/layer.cc
@@ -123,15 +123,15 @@ void Layer::Remove(Layer* child) {
child->DropTextures();
}
-void Layer::MoveToFront(Layer* child) {
+void Layer::StackAtTop(Layer* child) {
if (children_.size() <= 1 || child == children_.back())
return; // Already in front.
- MoveAbove(child, children_.back());
+ StackAbove(child, children_.back());
SetNeedsToRecomputeHole();
}
-void Layer::MoveAbove(Layer* child, Layer* other) {
+void Layer::StackAbove(Layer* child, Layer* other) {
DCHECK_NE(child, other);
DCHECK_EQ(this, child->parent());
DCHECK_EQ(this, other->parent());
diff --git a/ui/gfx/compositor/layer.h b/ui/gfx/compositor/layer.h
index 47b6a55..19949a1 100644
--- a/ui/gfx/compositor/layer.h
+++ b/ui/gfx/compositor/layer.h
@@ -69,12 +69,12 @@ class COMPOSITOR_EXPORT Layer :
// Removes a Layer from this Layer.
void Remove(Layer* child);
- // Moves a child to the end of the child list.
- void MoveToFront(Layer* child);
+ // Stacks |child| above all other children.
+ void StackAtTop(Layer* child);
- // Moves |child| to be above |other|. Does nothing if |other| is already above
- // |child|.
- void MoveAbove(Layer* child, Layer* other);
+ // Stacks |child| above |other|, both of which must be children of this layer.
+ // Does nothing if |other| is already above |child|.
+ void StackAbove(Layer* child, Layer* other);
// Returns the child Layers.
const std::vector<Layer*>& children() const { return children_; }
diff --git a/ui/gfx/compositor/layer_unittest.cc b/ui/gfx/compositor/layer_unittest.cc
index d9203ad..2e96cca 100644
--- a/ui/gfx/compositor/layer_unittest.cc
+++ b/ui/gfx/compositor/layer_unittest.cc
@@ -1243,7 +1243,7 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ModifyHierarchy) {
// WritePNGFile(bitmap, ref_img1);
EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img1));
- l0->MoveToFront(l11.get());
+ l0->StackAtTop(l11.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
@@ -1251,21 +1251,21 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ModifyHierarchy) {
EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2));
// l11 is already at the front, should have no effect.
- l0->MoveToFront(l11.get());
+ l0->StackAtTop(l11.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2));
// l11 is already at the front, should have no effect.
- l0->MoveAbove(l11.get(), l12.get());
+ l0->StackAbove(l11.get(), l12.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2));
// should restore to original configuration
- l0->MoveAbove(l12.get(), l11.get());
+ l0->StackAbove(l12.get(), l11.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());