OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
6 #include "ash/root_window_controller.h" | 6 #include "ash/root_window_controller.h" |
7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "ui/aura/test/test_windows.h" | 32 #include "ui/aura/test/test_windows.h" |
33 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
34 #include "ui/aura/window_event_dispatcher.h" | 34 #include "ui/aura/window_event_dispatcher.h" |
35 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 35 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
36 #include "ui/gfx/rect_conversions.h" | 36 #include "ui/gfx/rect_conversions.h" |
37 #include "ui/gfx/transform.h" | 37 #include "ui/gfx/transform.h" |
38 #include "ui/wm/core/window_util.h" | 38 #include "ui/wm/core/window_util.h" |
39 #include "ui/wm/public/activation_delegate.h" | 39 #include "ui/wm/public/activation_delegate.h" |
40 | 40 |
41 namespace ash { | 41 namespace ash { |
42 namespace internal { | |
43 | |
44 namespace { | 42 namespace { |
45 | 43 |
46 class NonActivatableActivationDelegate | 44 class NonActivatableActivationDelegate |
47 : public aura::client::ActivationDelegate { | 45 : public aura::client::ActivationDelegate { |
48 public: | 46 public: |
49 virtual bool ShouldActivate() const OVERRIDE { | 47 virtual bool ShouldActivate() const OVERRIDE { |
50 return false; | 48 return false; |
51 } | 49 } |
52 }; | 50 }; |
53 | 51 |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 } | 1029 } |
1032 | 1030 |
1033 // Tests starting overview during a drag and drop tracking operation. | 1031 // Tests starting overview during a drag and drop tracking operation. |
1034 // TODO(flackr): Fix memory corruption crash when running locally (not failing | 1032 // TODO(flackr): Fix memory corruption crash when running locally (not failing |
1035 // on bots). See http://crbug.com/342528. | 1033 // on bots). See http://crbug.com/342528. |
1036 TEST_F(WindowSelectorTest, DISABLED_DragDropInProgress) { | 1034 TEST_F(WindowSelectorTest, DISABLED_DragDropInProgress) { |
1037 bool drag_canceled_by_test = false; | 1035 bool drag_canceled_by_test = false; |
1038 gfx::Rect bounds(0, 0, 400, 400); | 1036 gfx::Rect bounds(0, 0, 400, 400); |
1039 scoped_ptr<aura::Window> window(CreateWindow(bounds)); | 1037 scoped_ptr<aura::Window> window(CreateWindow(bounds)); |
1040 test::ShellTestApi shell_test_api(Shell::GetInstance()); | 1038 test::ShellTestApi shell_test_api(Shell::GetInstance()); |
1041 ash::internal::DragDropController* drag_drop_controller = | 1039 ash::DragDropController* drag_drop_controller = |
1042 shell_test_api.drag_drop_controller(); | 1040 shell_test_api.drag_drop_controller(); |
1043 ui::OSExchangeData data; | 1041 ui::OSExchangeData data; |
1044 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 1042 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
1045 base::Bind(&WindowSelectorTest::ToggleOverview, | 1043 base::Bind(&WindowSelectorTest::ToggleOverview, |
1046 base::Unretained(this))); | 1044 base::Unretained(this))); |
1047 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 1045 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
1048 base::Bind(&CancelDrag, drag_drop_controller, &drag_canceled_by_test)); | 1046 base::Bind(&CancelDrag, drag_drop_controller, &drag_canceled_by_test)); |
1049 data.SetString(base::UTF8ToUTF16("I am being dragged")); | 1047 data.SetString(base::UTF8ToUTF16("I am being dragged")); |
1050 drag_drop_controller->StartDragAndDrop(data, window->GetRootWindow(), | 1048 drag_drop_controller->StartDragAndDrop(data, window->GetRootWindow(), |
1051 window.get(), gfx::Point(5, 5), ui::DragDropTypes::DRAG_MOVE, | 1049 window.get(), gfx::Point(5, 5), ui::DragDropTypes::DRAG_MOVE, |
(...skipping 30 matching lines...) Expand all Loading... |
1082 | 1080 |
1083 for (size_t p = 0; p < arraysize(points); ++p) { | 1081 for (size_t p = 0; p < arraysize(points); ++p) { |
1084 ui::MouseEvent event(ui::ET_MOUSE_MOVED, points[p], points[p], | 1082 ui::MouseEvent event(ui::ET_MOUSE_MOVED, points[p], points[p], |
1085 ui::EF_NONE, ui::EF_NONE); | 1083 ui::EF_NONE, ui::EF_NONE); |
1086 EXPECT_EQ(windows[w], | 1084 EXPECT_EQ(windows[w], |
1087 targeter->FindTargetForEvent(root_target, &event)); | 1085 targeter->FindTargetForEvent(root_target, &event)); |
1088 } | 1086 } |
1089 } | 1087 } |
1090 } | 1088 } |
1091 | 1089 |
1092 } // namespace internal | |
1093 } // namespace ash | 1090 } // namespace ash |
OLD | NEW |