Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: components/ui_devtools/devtools/window_element.cc

Issue 2852733002: Duplicate -Move DevTools out of ash and turn it to a component. (Closed)
Patch Set: move unittest to ui/views Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/ui_devtools/devtools/window_element.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/devtools/window_element.h"
6 6
7 #include "ash/devtools/ui_element_delegate.h" 7 #include "components/ui_devtools/devtools/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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return std::make_pair(window_, window_->GetBoundsInScreen()); 100 return std::make_pair(window_, window_->GetBoundsInScreen());
101 } 101 }
102 102
103 // static 103 // static
104 aura::Window* WindowElement::From(UIElement* element) { 104 aura::Window* WindowElement::From(UIElement* element) {
105 DCHECK_EQ(UIElementType::WINDOW, element->type()); 105 DCHECK_EQ(UIElementType::WINDOW, element->type());
106 return static_cast<WindowElement*>(element)->window_; 106 return static_cast<WindowElement*>(element)->window_;
107 } 107 }
108 108
109 } // namespace devtools 109 } // namespace devtools
110 } // namespace ash 110 } // namespace ui
OLDNEW
« no previous file with comments | « components/ui_devtools/devtools/window_element.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698