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

Side by Side Diff: chrome/browser/ui/views/tabs/window_finder_impl.cc

Issue 1562843002: Revert of Introduces window_finder_android.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/tabs/window_finder_impl.h"
6
7 #include "ui/aura/client/screen_position_client.h"
8 #include "ui/aura/window.h"
9 #include "ui/aura/window_event_dispatcher.h"
10 #include "ui/compositor/layer.h"
11 #include "ui/wm/core/window_util.h"
12
13 gfx::NativeWindow GetLocalProcessWindowAtPointImpl(
14 const gfx::Point& screen_point,
15 const std::set<gfx::NativeWindow>& ignore,
16 const std::set<int>& ignore_ids,
17 gfx::NativeWindow window) {
18 if (ignore.find(window) != ignore.end())
19 return nullptr;
20
21 if (!window->IsVisible())
22 return nullptr;
23
24 if (ignore_ids.find(window->id()) != ignore_ids.end())
25 return nullptr;
26
27 if (window->layer()->type() == ui::LAYER_TEXTURED) {
28 // Returns the window that has visible layer and can hit the
29 // |screen_point|, because we want to detach the tab as soon as
30 // the dragging mouse moved over to the window that can hide the
31 // moving tab.
32 aura::client::ScreenPositionClient* client =
33 aura::client::GetScreenPositionClient(window->GetRootWindow());
34 gfx::Point local_point = screen_point;
35 client->ConvertPointFromScreen(window, &local_point);
36 return window->GetEventHandlerForPoint(local_point) ? window : nullptr;
37 }
38
39 for (aura::Window::Windows::const_reverse_iterator i =
40 window->children().rbegin();
41 i != window->children().rend(); ++i) {
42 gfx::NativeWindow result =
43 GetLocalProcessWindowAtPointImpl(screen_point, ignore, ignore_ids, *i);
44 if (result)
45 return result;
46 }
47 return nullptr;
48 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/window_finder_impl.h ('k') | chrome/browser/ui/views/tabs/window_finder_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698