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

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

Issue 1421083003: Introduces window_finder_android.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reviews Created 5 years, 1 month 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/views/tabs/window_finder.h" 5 #include "chrome/browser/ui/views/tabs/window_finder.h"
6 6
7 #include "ash/shell_window_ids.h" 7 #include "ash/shell_window_ids.h"
8 #include "ash/wm/coordinate_conversion.h" 8 #include "ash/wm/coordinate_conversion.h"
9 #include "ui/aura/client/screen_position_client.h" 9 #include "chrome/browser/ui/views/tabs/window_finder_impl.h"
10 #include "ui/aura/window.h"
11 #include "ui/aura/window_event_dispatcher.h"
12 #include "ui/wm/core/window_util.h"
13
14 namespace {
15
16 gfx::NativeWindow GetLocalProcessWindowAtPointImpl(
17 const gfx::Point& screen_point,
18 const std::set<gfx::NativeWindow>& ignore,
19 gfx::NativeWindow window) {
20 if (ignore.find(window) != ignore.end())
21 return NULL;
22
23 if (!window->IsVisible())
24 return NULL;
25
26 if (window->id() == ash::kShellWindowId_PhantomWindow ||
27 window->id() == ash::kShellWindowId_OverlayContainer ||
28 window->id() == ash::kShellWindowId_MouseCursorContainer)
29 return NULL;
30
31 if (window->layer()->type() == ui::LAYER_TEXTURED) {
32 // Returns the window that has visible layer and can hit the
33 // |screen_point|, because we want to detach the tab as soon as
34 // the dragging mouse moved over to the window that can hide the
35 // moving tab.
36 aura::client::ScreenPositionClient* client =
37 aura::client::GetScreenPositionClient(window->GetRootWindow());
38 gfx::Point local_point = screen_point;
39 client->ConvertPointFromScreen(window, &local_point);
40 return window->GetEventHandlerForPoint(local_point) ? window : nullptr;
41 }
42
43 for (aura::Window::Windows::const_reverse_iterator i =
44 window->children().rbegin(); i != window->children().rend(); ++i) {
45 gfx::NativeWindow result =
46 GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i);
47 if (result)
48 return result;
49 }
50 return NULL;
51 }
52
53 } // namespace
54 10
55 gfx::NativeWindow GetLocalProcessWindowAtPointAsh( 11 gfx::NativeWindow GetLocalProcessWindowAtPointAsh(
56 const gfx::Point& screen_point, 12 const gfx::Point& screen_point,
57 const std::set<gfx::NativeWindow>& ignore) { 13 const std::set<gfx::NativeWindow>& ignore) {
58 return GetLocalProcessWindowAtPointImpl( 14 gfx::NativeWindow window = ::ash::wm::GetRootWindowAt(screen_point);
59 screen_point, ignore, ::ash::wm::GetRootWindowAt(screen_point)); 15 std::set<int> ignore_ash_ids = {ash::kShellWindowId_PhantomWindow,
16 ash::kShellWindowId_OverlayContainer,
17 ash::kShellWindowId_MouseCursorContainer};
18 return GetLocalProcessWindowAtPointImpl(screen_point, ignore, ignore_ash_ids,
19 window);
60 } 20 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/window_finder_android.cc ('k') | chrome/browser/ui/views/tabs/window_finder_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698