| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/aura/client/event_client.h" | 10 #include "ui/aura/client/event_client.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 return root_window_->GetChildById(kNonLockWindowId); | 329 return root_window_->GetChildById(kNonLockWindowId); |
| 330 } | 330 } |
| 331 | 331 |
| 332 private: | 332 private: |
| 333 // Overridden from client::EventClient: | 333 // Overridden from client::EventClient: |
| 334 virtual bool CanProcessEventsWithinSubtree( | 334 virtual bool CanProcessEventsWithinSubtree( |
| 335 const Window* window) const OVERRIDE { | 335 const Window* window) const OVERRIDE { |
| 336 return lock_ ? GetLockWindow()->Contains(window) : true; | 336 return lock_ ? GetLockWindow()->Contains(window) : true; |
| 337 } | 337 } |
| 338 | 338 |
| 339 virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE { |
| 340 return NULL; |
| 341 } |
| 342 |
| 339 RootWindow* root_window_; | 343 RootWindow* root_window_; |
| 340 bool lock_; | 344 bool lock_; |
| 341 | 345 |
| 342 DISALLOW_COPY_AND_ASSIGN(TestEventClient); | 346 DISALLOW_COPY_AND_ASSIGN(TestEventClient); |
| 343 }; | 347 }; |
| 344 | 348 |
| 345 } // namespace | 349 } // namespace |
| 346 | 350 |
| 347 TEST_F(RootWindowTest, CanProcessEventsWithinSubtree) { | 351 TEST_F(RootWindowTest, CanProcessEventsWithinSubtree) { |
| 348 TestEventClient client(root_window()); | 352 TestEventClient client(root_window()); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 TEST_F(RootWindowTest, GestureRecognizerResetsTargetWhenParentHides) { | 778 TEST_F(RootWindowTest, GestureRecognizerResetsTargetWhenParentHides) { |
| 775 scoped_ptr<Window> w1(CreateWindow(1, root_window(), NULL)); | 779 scoped_ptr<Window> w1(CreateWindow(1, root_window(), NULL)); |
| 776 DetachesParentOnTapDelegate delegate; | 780 DetachesParentOnTapDelegate delegate; |
| 777 scoped_ptr<Window> parent(CreateWindow(22, w1.get(), NULL)); | 781 scoped_ptr<Window> parent(CreateWindow(22, w1.get(), NULL)); |
| 778 Window* child = CreateWindow(11, parent.get(), &delegate); | 782 Window* child = CreateWindow(11, parent.get(), &delegate); |
| 779 test::EventGenerator generator(root_window(), child); | 783 test::EventGenerator generator(root_window(), child); |
| 780 generator.GestureTapAt(gfx::Point(40, 40)); | 784 generator.GestureTapAt(gfx::Point(40, 40)); |
| 781 } | 785 } |
| 782 | 786 |
| 783 } // namespace aura | 787 } // namespace aura |
| OLD | NEW |