OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/touch/touch_observer_hud.h" | 5 #include "ash/touch/touch_observer_hud.h" |
6 | 6 |
7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 RootWindowController* GetPrimaryRootController() { | 169 RootWindowController* GetPrimaryRootController() { |
170 aura::Window* root = GetPrimaryRootWindow(); | 170 aura::Window* root = GetPrimaryRootWindow(); |
171 return GetRootWindowController(root); | 171 return GetRootWindowController(root); |
172 } | 172 } |
173 | 173 |
174 RootWindowController* GetSecondaryRootController() { | 174 RootWindowController* GetSecondaryRootController() { |
175 aura::Window* root = GetSecondaryRootWindow(); | 175 aura::Window* root = GetSecondaryRootWindow(); |
176 return GetRootWindowController(root); | 176 return GetRootWindowController(root); |
177 } | 177 } |
178 | 178 |
179 DisplayInfo CreateDisplayInfo(int64_t id, const gfx::Rect& bounds) { | 179 display::ManagedDisplayInfo CreateDisplayInfo(int64_t id, |
180 DisplayInfo info(id, base::StringPrintf("x-%" PRId64, id), false); | 180 const gfx::Rect& bounds) { |
| 181 display::ManagedDisplayInfo info(id, base::StringPrintf("x-%" PRId64, id), |
| 182 false); |
181 info.SetBounds(bounds); | 183 info.SetBounds(bounds); |
182 return info; | 184 return info; |
183 } | 185 } |
184 | 186 |
185 aura::Window* GetRootWindowForTouchHud(TouchObserverHUD* hud) { | 187 aura::Window* GetRootWindowForTouchHud(TouchObserverHUD* hud) { |
186 return hud->root_window_; | 188 return hud->root_window_; |
187 } | 189 } |
188 | 190 |
189 views::Widget* GetWidgetForTouchHud(TouchObserverHUD* hud) { | 191 views::Widget* GetWidgetForTouchHud(TouchObserverHUD* hud) { |
190 return hud->widget_; | 192 return hud->widget_; |
191 } | 193 } |
192 | 194 |
193 int64_t internal_display_id_; | 195 int64_t internal_display_id_; |
194 int64_t external_display_id_; | 196 int64_t external_display_id_; |
195 int64_t mirrored_display_id_; | 197 int64_t mirrored_display_id_; |
196 DisplayInfo internal_display_info_; | 198 display::ManagedDisplayInfo internal_display_info_; |
197 DisplayInfo external_display_info_; | 199 display::ManagedDisplayInfo external_display_info_; |
198 DisplayInfo mirrored_display_info_; | 200 display::ManagedDisplayInfo mirrored_display_info_; |
199 | 201 |
200 std::vector<DisplayInfo> display_info_list_; | 202 std::vector<display::ManagedDisplayInfo> display_info_list_; |
201 | 203 |
202 DISALLOW_COPY_AND_ASSIGN(TouchHudTestBase); | 204 DISALLOW_COPY_AND_ASSIGN(TouchHudTestBase); |
203 }; | 205 }; |
204 | 206 |
205 class TouchHudDebugTest : public TouchHudTestBase { | 207 class TouchHudDebugTest : public TouchHudTestBase { |
206 public: | 208 public: |
207 TouchHudDebugTest() {} | 209 TouchHudDebugTest() {} |
208 ~TouchHudDebugTest() override {} | 210 ~TouchHudDebugTest() override {} |
209 | 211 |
210 void SetUp() override { | 212 void SetUp() override { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 615 |
614 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); | 616 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); |
615 EXPECT_EQ(1, GetInternalTouchPointsCount()); | 617 EXPECT_EQ(1, GetInternalTouchPointsCount()); |
616 | 618 |
617 // Disabling projection touch HUD shoud remove it without crashing. | 619 // Disabling projection touch HUD shoud remove it without crashing. |
618 DisableTouchHudProjection(); | 620 DisableTouchHudProjection(); |
619 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); | 621 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); |
620 } | 622 } |
621 | 623 |
622 } // namespace ash | 624 } // namespace ash |
OLD | NEW |