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

Side by Side Diff: components/mus/view_locator.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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/mus/view_locator.h ('k') | components/mus/view_manager_app.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/view_manager/view_locator.h" 5 #include "components/mus/view_locator.h"
6 6
7 #include "components/view_manager/server_view.h" 7 #include "components/mus/server_view.h"
8 8
9 namespace view_manager { 9 namespace view_manager {
10 10
11 const ServerView* FindDeepestVisibleView(const ServerView* view, 11 const ServerView* FindDeepestVisibleView(const ServerView* view,
12 const gfx::Point& location) { 12 const gfx::Point& location) {
13 for (const ServerView* child : view->GetChildren()) { 13 for (const ServerView* child : view->GetChildren()) {
14 if (!child->visible()) 14 if (!child->visible())
15 continue; 15 continue;
16 16
17 // TODO(sky): support transform. 17 // TODO(sky): support transform.
18 const gfx::Point child_location(location.x() - child->bounds().x(), 18 const gfx::Point child_location(location.x() - child->bounds().x(),
19 location.y() - child->bounds().y()); 19 location.y() - child->bounds().y());
20 if (child_location.x() >= 0 && child_location.y() >= 0 && 20 if (child_location.x() >= 0 && child_location.y() >= 0 &&
21 child_location.x() < child->bounds().width() && 21 child_location.x() < child->bounds().width() &&
22 child_location.y() < child->bounds().height()) { 22 child_location.y() < child->bounds().height()) {
23 return FindDeepestVisibleView(child, child_location); 23 return FindDeepestVisibleView(child, child_location);
24 } 24 }
25 } 25 }
26 return view; 26 return view;
27 } 27 }
28 28
29 ServerView* FindDeepestVisibleView(ServerView* view, 29 ServerView* FindDeepestVisibleView(ServerView* view,
30 const gfx::Point& location) { 30 const gfx::Point& location) {
31 return const_cast<ServerView*>( 31 return const_cast<ServerView*>(
32 FindDeepestVisibleView(const_cast<const ServerView*>(view), location)); 32 FindDeepestVisibleView(const_cast<const ServerView*>(view), location));
33 } 33 }
34 34
35 } // namespace view_manager 35 } // namespace view_manager
OLDNEW
« no previous file with comments | « components/mus/view_locator.h ('k') | components/mus/view_manager_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698