| 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 26 matching lines...) Expand all Loading... |
| 37 mirrored_display_id_ = 11; | 37 mirrored_display_id_ = 11; |
| 38 | 38 |
| 39 internal_display_info_ = | 39 internal_display_info_ = |
| 40 CreateDisplayInfo(internal_display_id_, gfx::Rect(0, 0, 500, 500)); | 40 CreateDisplayInfo(internal_display_id_, gfx::Rect(0, 0, 500, 500)); |
| 41 external_display_info_ = | 41 external_display_info_ = |
| 42 CreateDisplayInfo(external_display_id_, gfx::Rect(1, 1, 100, 100)); | 42 CreateDisplayInfo(external_display_id_, gfx::Rect(1, 1, 100, 100)); |
| 43 mirrored_display_info_ = | 43 mirrored_display_info_ = |
| 44 CreateDisplayInfo(mirrored_display_id_, gfx::Rect(0, 0, 100, 100)); | 44 CreateDisplayInfo(mirrored_display_id_, gfx::Rect(0, 0, 100, 100)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 gfx::Display GetPrimaryDisplay() { | 47 display::Display GetPrimaryDisplay() { |
| 48 return gfx::Screen::GetScreen()->GetPrimaryDisplay(); | 48 return display::Screen::GetScreen()->GetPrimaryDisplay(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 const gfx::Display& GetSecondaryDisplay() { | 51 const display::Display& GetSecondaryDisplay() { |
| 52 return ScreenUtil::GetSecondaryDisplay(); | 52 return ScreenUtil::GetSecondaryDisplay(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void SetupSingleDisplay() { | 55 void SetupSingleDisplay() { |
| 56 display_info_list_.clear(); | 56 display_info_list_.clear(); |
| 57 display_info_list_.push_back(internal_display_info_); | 57 display_info_list_.push_back(internal_display_info_); |
| 58 GetDisplayManager()->OnNativeDisplaysChanged(display_info_list_); | 58 GetDisplayManager()->OnNativeDisplaysChanged(display_info_list_); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void SetupDualDisplays() { | 61 void SetupDualDisplays() { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 protected: | 121 protected: |
| 122 DisplayManager* GetDisplayManager() { | 122 DisplayManager* GetDisplayManager() { |
| 123 return Shell::GetInstance()->display_manager(); | 123 return Shell::GetInstance()->display_manager(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 WindowTreeHostManager* GetWindowTreeHostManager() { | 126 WindowTreeHostManager* GetWindowTreeHostManager() { |
| 127 return Shell::GetInstance()->window_tree_host_manager(); | 127 return Shell::GetInstance()->window_tree_host_manager(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 const gfx::Display& GetInternalDisplay() { | 130 const display::Display& GetInternalDisplay() { |
| 131 return GetDisplayManager()->GetDisplayForId(internal_display_id_); | 131 return GetDisplayManager()->GetDisplayForId(internal_display_id_); |
| 132 } | 132 } |
| 133 | 133 |
| 134 const gfx::Display& GetExternalDisplay() { | 134 const display::Display& GetExternalDisplay() { |
| 135 return GetDisplayManager()->GetDisplayForId(external_display_id_); | 135 return GetDisplayManager()->GetDisplayForId(external_display_id_); |
| 136 } | 136 } |
| 137 | 137 |
| 138 aura::Window* GetInternalRootWindow() { | 138 aura::Window* GetInternalRootWindow() { |
| 139 return GetWindowTreeHostManager()->GetRootWindowForDisplayId( | 139 return GetWindowTreeHostManager()->GetRootWindowForDisplayId( |
| 140 internal_display_id_); | 140 internal_display_id_); |
| 141 } | 141 } |
| 142 | 142 |
| 143 aura::Window* GetExternalRootWindow() { | 143 aura::Window* GetExternalRootWindow() { |
| 144 return GetWindowTreeHostManager()->GetRootWindowForDisplayId( | 144 return GetWindowTreeHostManager()->GetRootWindowForDisplayId( |
| 145 external_display_id_); | 145 external_display_id_); |
| 146 } | 146 } |
| 147 | 147 |
| 148 aura::Window* GetPrimaryRootWindow() { | 148 aura::Window* GetPrimaryRootWindow() { |
| 149 const gfx::Display& display = GetPrimaryDisplay(); | 149 const display::Display& display = GetPrimaryDisplay(); |
| 150 return GetWindowTreeHostManager()->GetRootWindowForDisplayId(display.id()); | 150 return GetWindowTreeHostManager()->GetRootWindowForDisplayId(display.id()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 aura::Window* GetSecondaryRootWindow() { | 153 aura::Window* GetSecondaryRootWindow() { |
| 154 const gfx::Display& display = GetSecondaryDisplay(); | 154 const display::Display& display = GetSecondaryDisplay(); |
| 155 return GetWindowTreeHostManager()->GetRootWindowForDisplayId(display.id()); | 155 return GetWindowTreeHostManager()->GetRootWindowForDisplayId(display.id()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 RootWindowController* GetInternalRootController() { | 158 RootWindowController* GetInternalRootController() { |
| 159 aura::Window* root = GetInternalRootWindow(); | 159 aura::Window* root = GetInternalRootWindow(); |
| 160 return GetRootWindowController(root); | 160 return GetRootWindowController(root); |
| 161 } | 161 } |
| 162 | 162 |
| 163 RootWindowController* GetExternalRootController() { | 163 RootWindowController* GetExternalRootController() { |
| 164 aura::Window* root = GetExternalRootWindow(); | 164 aura::Window* root = GetExternalRootWindow(); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 | 608 |
| 609 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); | 609 SendTouchEventToInternalHud(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); |
| 610 EXPECT_EQ(1, GetInternalTouchPointsCount()); | 610 EXPECT_EQ(1, GetInternalTouchPointsCount()); |
| 611 | 611 |
| 612 // Disabling projection touch HUD shoud remove it without crashing. | 612 // Disabling projection touch HUD shoud remove it without crashing. |
| 613 DisableTouchHudProjection(); | 613 DisableTouchHudProjection(); |
| 614 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); | 614 EXPECT_EQ(NULL, GetInternalTouchHudProjection()); |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // namespace ash | 617 } // namespace ash |
| OLD | NEW |