| 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 ui::DisplayInfo CreateDisplayInfo(int64_t id, const gfx::Rect& bounds) { |
| 180 DisplayInfo info(id, base::StringPrintf("x-%" PRId64, id), false); | 180 ui::DisplayInfo info(id, base::StringPrintf("x-%" PRId64, id), false); |
| 181 info.SetBounds(bounds); | 181 info.SetBounds(bounds); |
| 182 return info; | 182 return info; |
| 183 } | 183 } |
| 184 | 184 |
| 185 aura::Window* GetRootWindowForTouchHud(TouchObserverHUD* hud) { | 185 aura::Window* GetRootWindowForTouchHud(TouchObserverHUD* hud) { |
| 186 return hud->root_window_; | 186 return hud->root_window_; |
| 187 } | 187 } |
| 188 | 188 |
| 189 views::Widget* GetWidgetForTouchHud(TouchObserverHUD* hud) { | 189 views::Widget* GetWidgetForTouchHud(TouchObserverHUD* hud) { |
| 190 return hud->widget_; | 190 return hud->widget_; |
| 191 } | 191 } |
| 192 | 192 |
| 193 int64_t internal_display_id_; | 193 int64_t internal_display_id_; |
| 194 int64_t external_display_id_; | 194 int64_t external_display_id_; |
| 195 int64_t mirrored_display_id_; | 195 int64_t mirrored_display_id_; |
| 196 DisplayInfo internal_display_info_; | 196 ui::DisplayInfo internal_display_info_; |
| 197 DisplayInfo external_display_info_; | 197 ui::DisplayInfo external_display_info_; |
| 198 DisplayInfo mirrored_display_info_; | 198 ui::DisplayInfo mirrored_display_info_; |
| 199 | 199 |
| 200 std::vector<DisplayInfo> display_info_list_; | 200 std::vector<ui::DisplayInfo> display_info_list_; |
| 201 | 201 |
| 202 DISALLOW_COPY_AND_ASSIGN(TouchHudTestBase); | 202 DISALLOW_COPY_AND_ASSIGN(TouchHudTestBase); |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 class TouchHudDebugTest : public TouchHudTestBase { | 205 class TouchHudDebugTest : public TouchHudTestBase { |
| 206 public: | 206 public: |
| 207 TouchHudDebugTest() {} | 207 TouchHudDebugTest() {} |
| 208 ~TouchHudDebugTest() override {} | 208 ~TouchHudDebugTest() override {} |
| 209 | 209 |
| 210 void SetUp() override { | 210 void SetUp() override { |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 613 |
| 614 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); | 614 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); |
| 615 EXPECT_EQ(1, GetInternalTouchPointsCount()); | 615 EXPECT_EQ(1, GetInternalTouchPointsCount()); |
| 616 | 616 |
| 617 // Disabling projection touch HUD shoud remove it without crashing. | 617 // Disabling projection touch HUD shoud remove it without crashing. |
| 618 DisableTouchHudProjection(); | 618 DisableTouchHudProjection(); |
| 619 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); | 619 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); |
| 620 } | 620 } |
| 621 | 621 |
| 622 } // namespace ash | 622 } // namespace ash |
| OLD | NEW |