| 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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "ui/views/window/dialog_delegate.h" | 35 #include "ui/views/window/dialog_delegate.h" |
| 36 | 36 |
| 37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 38 #include "ui/views/test/test_views_delegate.h" | 38 #include "ui/views/test/test_views_delegate.h" |
| 39 #endif | 39 #endif |
| 40 #if defined(USE_AURA) | 40 #if defined(USE_AURA) |
| 41 #include "ui/aura/root_window.h" | 41 #include "ui/aura/root_window.h" |
| 42 #include "ui/events/gestures/gesture_recognizer.h" | 42 #include "ui/events/gestures/gesture_recognizer.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 using base::ASCIIToUTF16; |
| 46 |
| 45 namespace { | 47 namespace { |
| 46 | 48 |
| 47 // Returns true if |ancestor| is an ancestor of |layer|. | 49 // Returns true if |ancestor| is an ancestor of |layer|. |
| 48 bool LayerIsAncestor(const ui::Layer* ancestor, const ui::Layer* layer) { | 50 bool LayerIsAncestor(const ui::Layer* ancestor, const ui::Layer* layer) { |
| 49 while (layer && layer != ancestor) | 51 while (layer && layer != ancestor) |
| 50 layer = layer->parent(); | 52 layer = layer->parent(); |
| 51 return layer == ancestor; | 53 return layer == ancestor; |
| 52 } | 54 } |
| 53 | 55 |
| 54 // Convenience functions for walking a View tree. | 56 // Convenience functions for walking a View tree. |
| (...skipping 3509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3564 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); | 3566 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); |
| 3565 ASSERT_EQ(3u, child_layers_post.size()); | 3567 ASSERT_EQ(3u, child_layers_post.size()); |
| 3566 EXPECT_EQ(v1->layer(), child_layers_post[0]); | 3568 EXPECT_EQ(v1->layer(), child_layers_post[0]); |
| 3567 EXPECT_EQ(v2->layer(), child_layers_post[1]); | 3569 EXPECT_EQ(v2->layer(), child_layers_post[1]); |
| 3568 EXPECT_EQ(v1_old_layer, child_layers_post[2]); | 3570 EXPECT_EQ(v1_old_layer, child_layers_post[2]); |
| 3569 } | 3571 } |
| 3570 | 3572 |
| 3571 #endif // USE_AURA | 3573 #endif // USE_AURA |
| 3572 | 3574 |
| 3573 } // namespace views | 3575 } // namespace views |
| OLD | NEW |