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

Unified Diff: chrome/browser/ui/views/tabs/window_finder_ash.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tabs/window_finder_ash.cc
diff --git a/chrome/browser/ui/views/tabs/window_finder_ash.cc b/chrome/browser/ui/views/tabs/window_finder_ash.cc
index e6de7109827b967937d10a432068b1576f325209..1628a82d49f01dfa0ae962ce5d8efced3b7fa7da 100644
--- a/chrome/browser/ui/views/tabs/window_finder_ash.cc
+++ b/chrome/browser/ui/views/tabs/window_finder_ash.cc
@@ -6,15 +6,55 @@
#include "ash/shell_window_ids.h"
#include "ash/wm/coordinate_conversion.h"
-#include "chrome/browser/ui/views/tabs/window_finder_impl.h"
+#include "ui/aura/client/screen_position_client.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
+#include "ui/wm/core/window_util.h"
+
+namespace {
+
+gfx::NativeWindow GetLocalProcessWindowAtPointImpl(
+ const gfx::Point& screen_point,
+ const std::set<gfx::NativeWindow>& ignore,
+ gfx::NativeWindow window) {
+ if (ignore.find(window) != ignore.end())
+ return NULL;
+
+ if (!window->IsVisible())
+ return NULL;
+
+ if (window->id() == ash::kShellWindowId_PhantomWindow ||
+ window->id() == ash::kShellWindowId_OverlayContainer ||
+ window->id() == ash::kShellWindowId_MouseCursorContainer)
+ return NULL;
+
+ if (window->layer()->type() == ui::LAYER_TEXTURED) {
+ // Returns the window that has visible layer and can hit the
+ // |screen_point|, because we want to detach the tab as soon as
+ // the dragging mouse moved over to the window that can hide the
+ // moving tab.
+ aura::client::ScreenPositionClient* client =
+ aura::client::GetScreenPositionClient(window->GetRootWindow());
+ gfx::Point local_point = screen_point;
+ client->ConvertPointFromScreen(window, &local_point);
+ return window->GetEventHandlerForPoint(local_point) ? window : nullptr;
+ }
+
+ for (aura::Window::Windows::const_reverse_iterator i =
+ window->children().rbegin(); i != window->children().rend(); ++i) {
+ gfx::NativeWindow result =
+ GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i);
+ if (result)
+ return result;
+ }
+ return NULL;
+}
+
+} // namespace
gfx::NativeWindow GetLocalProcessWindowAtPointAsh(
const gfx::Point& screen_point,
const std::set<gfx::NativeWindow>& ignore) {
- gfx::NativeWindow window = ::ash::wm::GetRootWindowAt(screen_point);
- std::set<int> ignore_ash_ids = {ash::kShellWindowId_PhantomWindow,
- ash::kShellWindowId_OverlayContainer,
- ash::kShellWindowId_MouseCursorContainer};
- return GetLocalProcessWindowAtPointImpl(screen_point, ignore, ignore_ash_ids,
- window);
+ return GetLocalProcessWindowAtPointImpl(
+ screen_point, ignore, ::ash::wm::GetRootWindowAt(screen_point));
}
« 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