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/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" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // An event filter which moves the target window to the secondary root window | 83 // An event filter which moves the target window to the secondary root window |
84 // at pre-handle phase of a mouse release event. | 84 // at pre-handle phase of a mouse release event. |
85 class MoveWindowByClickEventFilter : public ui::EventHandler { | 85 class MoveWindowByClickEventFilter : public ui::EventHandler { |
86 public: | 86 public: |
87 explicit MoveWindowByClickEventFilter(aura::Window* target) | 87 explicit MoveWindowByClickEventFilter(aura::Window* target) |
88 : target_(target) {} | 88 : target_(target) {} |
89 virtual ~MoveWindowByClickEventFilter() {} | 89 virtual ~MoveWindowByClickEventFilter() {} |
90 | 90 |
91 private: | 91 private: |
92 // ui::EventHandler overrides: | 92 // ui::EventHandler overrides: |
93 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE { | 93 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { |
94 if (event->type() == ui::ET_MOUSE_RELEASED) { | 94 if (event->type() == ui::ET_MOUSE_RELEASED) { |
95 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 95 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
96 DCHECK_LT(1u, root_windows.size()); | 96 DCHECK_LT(1u, root_windows.size()); |
97 root_windows[1]->AddChild(target_); | 97 root_windows[1]->AddChild(target_); |
98 } | 98 } |
99 return ui::ER_UNHANDLED; | |
100 } | 99 } |
101 | 100 |
102 aura::Window* target_; | 101 aura::Window* target_; |
103 DISALLOW_COPY_AND_ASSIGN(MoveWindowByClickEventFilter); | 102 DISALLOW_COPY_AND_ASSIGN(MoveWindowByClickEventFilter); |
104 }; | 103 }; |
105 | 104 |
106 } // namespace | 105 } // namespace |
107 | 106 |
108 typedef test::AshTestBase ExtendedDesktopTest; | 107 typedef test::AshTestBase ExtendedDesktopTest; |
109 | 108 |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 688 |
690 aura::test::EventGenerator generator22(root_windows[1]); | 689 aura::test::EventGenerator generator22(root_windows[1]); |
691 generator22.PressKey(ui::VKEY_E, 0); | 690 generator22.PressKey(ui::VKEY_E, 0); |
692 generator22.ReleaseKey(ui::VKEY_E, 0); | 691 generator22.ReleaseKey(ui::VKEY_E, 0); |
693 EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); | 692 EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); |
694 EXPECT_EQ("abcde", UTF16ToASCII(textfield->text())); | 693 EXPECT_EQ("abcde", UTF16ToASCII(textfield->text())); |
695 } | 694 } |
696 | 695 |
697 } // namespace internal | 696 } // namespace internal |
698 } // namespace ash | 697 } // namespace ash |
OLD | NEW |