OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ash/devtools/window_element.h" | 5 #include "components/ui_devtools/views/window_element.h" |
6 | 6 |
7 #include "ash/devtools/ui_element_delegate.h" | 7 #include "components/ui_devtools/views/ui_element_delegate.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 | 9 |
10 namespace ash { | 10 namespace ui { |
11 namespace devtools { | 11 namespace devtools { |
12 namespace { | 12 namespace { |
13 | 13 |
14 int GetIndexOfChildInParent(aura::Window* window) { | 14 int GetIndexOfChildInParent(aura::Window* window) { |
15 const aura::Window::Windows& siblings = window->parent()->children(); | 15 const aura::Window::Windows& siblings = window->parent()->children(); |
16 auto it = std::find(siblings.begin(), siblings.end(), window); | 16 auto it = std::find(siblings.begin(), siblings.end(), window); |
17 DCHECK(it != siblings.end()); | 17 DCHECK(it != siblings.end()); |
18 return std::distance(siblings.begin(), it); | 18 return std::distance(siblings.begin(), it); |
19 } | 19 } |
20 | 20 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return std::make_pair(window_, window_->GetBoundsInScreen()); | 90 return std::make_pair(window_, window_->GetBoundsInScreen()); |
91 } | 91 } |
92 | 92 |
93 // static | 93 // static |
94 aura::Window* WindowElement::From(UIElement* element) { | 94 aura::Window* WindowElement::From(UIElement* element) { |
95 DCHECK_EQ(UIElementType::WINDOW, element->type()); | 95 DCHECK_EQ(UIElementType::WINDOW, element->type()); |
96 return static_cast<WindowElement*>(element)->window_; | 96 return static_cast<WindowElement*>(element)->window_; |
97 } | 97 } |
98 | 98 |
99 } // namespace devtools | 99 } // namespace devtools |
100 } // namespace ash | 100 } // namespace ui |
OLD | NEW |