Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2829 | 2829 |
| 2830 content_view->RemoveChildView(v1); | 2830 content_view->RemoveChildView(v1); |
| 2831 EXPECT_FALSE(LayerIsAncestor(widget()->GetCompositor()->root_layer(), | 2831 EXPECT_FALSE(LayerIsAncestor(widget()->GetCompositor()->root_layer(), |
| 2832 v2->layer())); | 2832 v2->layer())); |
| 2833 | 2833 |
| 2834 // Reparent |v2|. | 2834 // Reparent |v2|. |
| 2835 content_view->AddChildView(v2); | 2835 content_view->AddChildView(v2); |
| 2836 EXPECT_TRUE(LayerIsAncestor(widget()->GetCompositor()->root_layer(), | 2836 EXPECT_TRUE(LayerIsAncestor(widget()->GetCompositor()->root_layer(), |
| 2837 v2->layer())); | 2837 v2->layer())); |
| 2838 EXPECT_TRUE(v2->layer()->IsDrawn()); | 2838 EXPECT_TRUE(v2->layer()->IsDrawn()); |
| 2839 | |
| 2840 delete v1; | |
|
sky
2012/02/06 17:55:47
Can we delete this right after we remove it from t
sadrul
2012/02/06 19:48:30
Done.
| |
| 2839 } | 2841 } |
| 2840 | 2842 |
| 2841 class PaintTrackingView : public View { | 2843 class PaintTrackingView : public View { |
| 2842 public: | 2844 public: |
| 2843 PaintTrackingView() : painted_(false) { | 2845 PaintTrackingView() : painted_(false) { |
| 2844 } | 2846 } |
| 2845 | 2847 |
| 2846 bool painted() const { return painted_; } | 2848 bool painted() const { return painted_; } |
| 2847 void set_painted(bool value) { painted_ = value; } | 2849 void set_painted(bool value) { painted_ = value; } |
| 2848 | 2850 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2966 | 2968 |
| 2967 // Move c1 to the front. The layers should have moved too. | 2969 // Move c1 to the front. The layers should have moved too. |
| 2968 content->ReorderChildView(c1, -1); | 2970 content->ReorderChildView(c1, -1); |
| 2969 EXPECT_EQ(c1->layer(), parent_layer->children()[1]); | 2971 EXPECT_EQ(c1->layer(), parent_layer->children()[1]); |
| 2970 EXPECT_EQ(c2->layer(), parent_layer->children()[0]); | 2972 EXPECT_EQ(c2->layer(), parent_layer->children()[0]); |
| 2971 } | 2973 } |
| 2972 | 2974 |
| 2973 #endif // USE_AURA | 2975 #endif // USE_AURA |
| 2974 | 2976 |
| 2975 } // namespace views | 2977 } // namespace views |
| OLD | NEW |