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 "ash/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
6 #include "ash/display/multi_display_manager.h" | 6 #include "ash/display/display_manager.h" |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
12 #include "ash/wm/coordinate_conversion.h" | 12 #include "ash/wm/coordinate_conversion.h" |
13 #include "ash/wm/property_util.h" | 13 #include "ash/wm/property_util.h" |
14 #include "ash/wm/window_cycle_controller.h" | 14 #include "ash/wm/window_cycle_controller.h" |
15 #include "ash/wm/window_properties.h" | 15 #include "ash/wm/window_properties.h" |
16 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "ui/aura/client/activation_client.h" | 18 #include "ui/aura/client/activation_client.h" |
19 #include "ui/aura/client/capture_client.h" | 19 #include "ui/aura/client/capture_client.h" |
20 #include "ui/aura/env.h" | |
21 #include "ui/aura/focus_manager.h" | 20 #include "ui/aura/focus_manager.h" |
22 #include "ui/aura/root_window.h" | 21 #include "ui/aura/root_window.h" |
23 #include "ui/aura/test/event_generator.h" | 22 #include "ui/aura/test/event_generator.h" |
24 #include "ui/aura/test/test_windows.h" | 23 #include "ui/aura/test/test_windows.h" |
25 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
26 #include "ui/base/cursor/cursor.h" | 25 #include "ui/base/cursor/cursor.h" |
27 #include "ui/base/events/event_handler.h" | 26 #include "ui/base/events/event_handler.h" |
28 #include "ui/gfx/display.h" | 27 #include "ui/gfx/display.h" |
29 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
30 #include "ui/views/controls/textfield/textfield.h" | 29 #include "ui/views/controls/textfield/textfield.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return this; | 68 return this; |
70 } | 69 } |
71 virtual ui::ModalType GetModalType() const OVERRIDE { | 70 virtual ui::ModalType GetModalType() const OVERRIDE { |
72 return ui::MODAL_TYPE_SYSTEM; | 71 return ui::MODAL_TYPE_SYSTEM; |
73 } | 72 } |
74 | 73 |
75 private: | 74 private: |
76 DISALLOW_COPY_AND_ASSIGN(ModalWidgetDelegate); | 75 DISALLOW_COPY_AND_ASSIGN(ModalWidgetDelegate); |
77 }; | 76 }; |
78 | 77 |
79 internal::MultiDisplayManager* GetDisplayManager() { | 78 internal::DisplayManager* GetDisplayManager() { |
80 return static_cast<internal::MultiDisplayManager*>( | 79 return Shell::GetInstance()->display_manager(); |
81 aura::Env::GetInstance()->display_manager()); | |
82 } | 80 } |
83 | 81 |
84 // An event filter which moves the target window to the secondary root window | 82 // An event filter which moves the target window to the secondary root window |
85 // at pre-handle phase of a mouse release event. | 83 // at pre-handle phase of a mouse release event. |
86 class MoveWindowByClickEventFilter : public ui::EventHandler { | 84 class MoveWindowByClickEventFilter : public ui::EventHandler { |
87 public: | 85 public: |
88 explicit MoveWindowByClickEventFilter(aura::Window* target) | 86 explicit MoveWindowByClickEventFilter(aura::Window* target) |
89 : target_(target) {} | 87 : target_(target) {} |
90 virtual ~MoveWindowByClickEventFilter() {} | 88 virtual ~MoveWindowByClickEventFilter() {} |
91 | 89 |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 | 720 |
723 aura::test::EventGenerator generator22(root_windows[1]); | 721 aura::test::EventGenerator generator22(root_windows[1]); |
724 generator22.PressKey(ui::VKEY_E, 0); | 722 generator22.PressKey(ui::VKEY_E, 0); |
725 generator22.ReleaseKey(ui::VKEY_E, 0); | 723 generator22.ReleaseKey(ui::VKEY_E, 0); |
726 EXPECT_EQ(lock_widget->GetNativeView(), focus_manager->GetFocusedWindow()); | 724 EXPECT_EQ(lock_widget->GetNativeView(), focus_manager->GetFocusedWindow()); |
727 EXPECT_EQ("abcde", UTF16ToASCII(textfield->text())); | 725 EXPECT_EQ("abcde", UTF16ToASCII(textfield->text())); |
728 } | 726 } |
729 | 727 |
730 } // namespace internal | 728 } // namespace internal |
731 } // namespace ash | 729 } // namespace ash |
OLD | NEW |