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

Unified Diff: ui/aura/test/window_test_api.cc

Issue 602043006: aura: Move Window::ContainsMouse() implementation into the test API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/aura/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/window_test_api.cc
diff --git a/ui/aura/test/window_test_api.cc b/ui/aura/test/window_test_api.cc
index 0ea3e18a0a10e261f16221cf78a9ee7eeff833bc..86b3370b1126ddfa27973e22af16987e7f574f8b 100644
--- a/ui/aura/test/window_test_api.cc
+++ b/ui/aura/test/window_test_api.cc
@@ -5,6 +5,8 @@
#include "ui/aura/test/window_test_api.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
+#include "ui/aura/window_tree_host.h"
namespace aura {
namespace test {
@@ -17,7 +19,12 @@ bool WindowTestApi::OwnsLayer() const {
}
bool WindowTestApi::ContainsMouse() const {
- return window_->ContainsMouse();
+ if (!window_->IsVisible())
+ return false;
+ WindowTreeHost* host = window_->GetHost();
+ return host &&
+ window_->ContainsPointInRoot(
+ host->dispatcher()->GetLastMouseLocationInRoot());
}
} // namespace test
« no previous file with comments | « no previous file | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698