| 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/ash_switches.h" | 7 #include "ash/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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 display_info_list_.push_back(internal_display_info_); | 111 display_info_list_.push_back(internal_display_info_); |
| 112 GetDisplayManager()->OnNativeDisplaysChanged(display_info_list_); | 112 GetDisplayManager()->OnNativeDisplaysChanged(display_info_list_); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void AddExternalDisplay() { | 115 void AddExternalDisplay() { |
| 116 DCHECK_EQ(1U, display_info_list_.size()); | 116 DCHECK_EQ(1U, display_info_list_.size()); |
| 117 display_info_list_.push_back(external_display_info_); | 117 display_info_list_.push_back(external_display_info_); |
| 118 GetDisplayManager()->OnNativeDisplaysChanged(display_info_list_); | 118 GetDisplayManager()->OnNativeDisplaysChanged(display_info_list_); |
| 119 } | 119 } |
| 120 | 120 |
| 121 int64 internal_display_id() const { | 121 int64_t internal_display_id() const { return internal_display_id_; } |
| 122 return internal_display_id_; | |
| 123 } | |
| 124 | 122 |
| 125 int64 external_display_id() const { | 123 int64_t external_display_id() const { return external_display_id_; } |
| 126 return external_display_id_; | |
| 127 } | |
| 128 | 124 |
| 129 protected: | 125 protected: |
| 130 DisplayManager* GetDisplayManager() { | 126 DisplayManager* GetDisplayManager() { |
| 131 return Shell::GetInstance()->display_manager(); | 127 return Shell::GetInstance()->display_manager(); |
| 132 } | 128 } |
| 133 | 129 |
| 134 WindowTreeHostManager* GetWindowTreeHostManager() { | 130 WindowTreeHostManager* GetWindowTreeHostManager() { |
| 135 return Shell::GetInstance()->window_tree_host_manager(); | 131 return Shell::GetInstance()->window_tree_host_manager(); |
| 136 } | 132 } |
| 137 | 133 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 RootWindowController* GetPrimaryRootController() { | 172 RootWindowController* GetPrimaryRootController() { |
| 177 aura::Window* root = GetPrimaryRootWindow(); | 173 aura::Window* root = GetPrimaryRootWindow(); |
| 178 return GetRootWindowController(root); | 174 return GetRootWindowController(root); |
| 179 } | 175 } |
| 180 | 176 |
| 181 RootWindowController* GetSecondaryRootController() { | 177 RootWindowController* GetSecondaryRootController() { |
| 182 aura::Window* root = GetSecondaryRootWindow(); | 178 aura::Window* root = GetSecondaryRootWindow(); |
| 183 return GetRootWindowController(root); | 179 return GetRootWindowController(root); |
| 184 } | 180 } |
| 185 | 181 |
| 186 DisplayInfo CreateDisplayInfo(int64 id, const gfx::Rect& bounds) { | 182 DisplayInfo CreateDisplayInfo(int64_t id, const gfx::Rect& bounds) { |
| 187 DisplayInfo info(id, base::StringPrintf("x-%" PRId64, id), false); | 183 DisplayInfo info(id, base::StringPrintf("x-%" PRId64, id), false); |
| 188 info.SetBounds(bounds); | 184 info.SetBounds(bounds); |
| 189 return info; | 185 return info; |
| 190 } | 186 } |
| 191 | 187 |
| 192 aura::Window* GetRootWindowForTouchHud(TouchObserverHUD* hud) { | 188 aura::Window* GetRootWindowForTouchHud(TouchObserverHUD* hud) { |
| 193 return hud->root_window_; | 189 return hud->root_window_; |
| 194 } | 190 } |
| 195 | 191 |
| 196 views::Widget* GetWidgetForTouchHud(TouchObserverHUD* hud) { | 192 views::Widget* GetWidgetForTouchHud(TouchObserverHUD* hud) { |
| 197 return hud->widget_; | 193 return hud->widget_; |
| 198 } | 194 } |
| 199 | 195 |
| 200 int64 internal_display_id_; | 196 int64_t internal_display_id_; |
| 201 int64 external_display_id_; | 197 int64_t external_display_id_; |
| 202 int64 mirrored_display_id_; | 198 int64_t mirrored_display_id_; |
| 203 DisplayInfo internal_display_info_; | 199 DisplayInfo internal_display_info_; |
| 204 DisplayInfo external_display_info_; | 200 DisplayInfo external_display_info_; |
| 205 DisplayInfo mirrored_display_info_; | 201 DisplayInfo mirrored_display_info_; |
| 206 | 202 |
| 207 std::vector<DisplayInfo> display_info_list_; | 203 std::vector<DisplayInfo> display_info_list_; |
| 208 | 204 |
| 209 DISALLOW_COPY_AND_ASSIGN(TouchHudTestBase); | 205 DISALLOW_COPY_AND_ASSIGN(TouchHudTestBase); |
| 210 }; | 206 }; |
| 211 | 207 |
| 212 class TouchHudDebugTest : public TouchHudTestBase { | 208 class TouchHudDebugTest : public TouchHudTestBase { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 581 |
| 586 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); | 582 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); |
| 587 EXPECT_EQ(1, GetInternalTouchPointsCount()); | 583 EXPECT_EQ(1, GetInternalTouchPointsCount()); |
| 588 | 584 |
| 589 // Disabling projection touch HUD shoud remove it without crashing. | 585 // Disabling projection touch HUD shoud remove it without crashing. |
| 590 DisableTouchHudProjection(); | 586 DisableTouchHudProjection(); |
| 591 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); | 587 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); |
| 592 } | 588 } |
| 593 | 589 |
| 594 } // namespace ash | 590 } // namespace ash |
| OLD | NEW |