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/views/corewm/window_modality_controller.h" | 5 #include "ui/views/corewm/window_modality_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 virtual ~TouchTrackerWindowDelegate() {} | 291 virtual ~TouchTrackerWindowDelegate() {} |
292 | 292 |
293 void reset() { | 293 void reset() { |
294 received_touch_ = false; | 294 received_touch_ = false; |
295 } | 295 } |
296 | 296 |
297 bool received_touch() const { return received_touch_; } | 297 bool received_touch() const { return received_touch_; } |
298 | 298 |
299 private: | 299 private: |
300 // Overridden from aura::test::TestWindowDelegate. | 300 // Overridden from aura::test::TestWindowDelegate. |
301 virtual ui::EventResult OnTouchEvent(ui::TouchEvent* event) OVERRIDE { | 301 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE { |
302 received_touch_ = true; | 302 received_touch_ = true; |
303 return aura::test::TestWindowDelegate::OnTouchEvent(event); | 303 aura::test::TestWindowDelegate::OnTouchEvent(event); |
304 } | 304 } |
305 | 305 |
306 bool received_touch_; | 306 bool received_touch_; |
307 | 307 |
308 DISALLOW_COPY_AND_ASSIGN(TouchTrackerWindowDelegate); | 308 DISALLOW_COPY_AND_ASSIGN(TouchTrackerWindowDelegate); |
309 }; | 309 }; |
310 | 310 |
311 // Modality should prevent events from being passed to the transient parent. | 311 // Modality should prevent events from being passed to the transient parent. |
312 TEST_F(WindowModalityControllerTest, TouchEvent) { | 312 TEST_F(WindowModalityControllerTest, TouchEvent) { |
313 TouchTrackerWindowDelegate d1; | 313 TouchTrackerWindowDelegate d1; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 | 546 |
547 wm::ActivateWindow(w3.get()); | 547 wm::ActivateWindow(w3.get()); |
548 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); | 548 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); |
549 | 549 |
550 wm::ActivateWindow(w4.get()); | 550 wm::ActivateWindow(w4.get()); |
551 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); | 551 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); |
552 } | 552 } |
553 | 553 |
554 } // namespace internal | 554 } // namespace internal |
555 } // namespace ash | 555 } // namespace ash |
OLD | NEW |