Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / aura / test / window_test_api.cc
1 // Copyright 2012 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 "ui/aura/test/window_test_api.h"
6
7 #include "ui/aura/window.h"
8 #include "ui/aura/window_event_dispatcher.h"
9 #include "ui/aura/window_tree_host.h"
10
11 namespace aura {
12 namespace test {
13
14 WindowTestApi::WindowTestApi(Window* window) : window_(window) {
15 }
16
17 bool WindowTestApi::OwnsLayer() const {
18   return window_->OwnsLayer();
19 }
20
21 bool WindowTestApi::ContainsMouse() const {
22   if (!window_->IsVisible())
23     return false;
24   WindowTreeHost* host = window_->GetHost();
25   return host &&
26          window_->ContainsPointInRoot(
27              host->dispatcher()->GetLastMouseLocationInRoot());
28 }
29
30 }  // namespace test
31 }  // namespace aura