| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/display/display_util.h" | 5 #include "ash/display/display_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/common/system/system_notifier.h" | 10 #include "ash/common/system/system_notifier.h" |
| 11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 12 #include "ash/display/display_manager.h" | |
| 13 #include "ash/display/extended_mouse_warp_controller.h" | 12 #include "ash/display/extended_mouse_warp_controller.h" |
| 14 #include "ash/display/null_mouse_warp_controller.h" | 13 #include "ash/display/null_mouse_warp_controller.h" |
| 15 #include "ash/display/unified_mouse_warp_controller.h" | 14 #include "ash/display/unified_mouse_warp_controller.h" |
| 16 #include "ash/host/ash_window_tree_host.h" | 15 #include "ash/host/ash_window_tree_host.h" |
| 17 #include "ash/public/interfaces/new_window.mojom.h" | 16 #include "ash/public/interfaces/new_window.mojom.h" |
| 18 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| 19 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 20 #include "grit/ash_resources.h" | 19 #include "grit/ash_resources.h" |
| 21 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
| 22 #include "ui/aura/window_tree_host.h" | 21 #include "ui/aura/window_tree_host.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 25 #include "ui/display/display.h" | 24 #include "ui/display/display.h" |
| 25 #include "ui/display/manager/display_manager.h" |
| 26 #include "ui/display/manager/managed_display_info.h" | 26 #include "ui/display/manager/managed_display_info.h" |
| 27 #include "ui/gfx/geometry/point.h" | 27 #include "ui/gfx/geometry/point.h" |
| 28 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
| 29 #include "ui/gfx/geometry/size_conversions.h" | 29 #include "ui/gfx/geometry/size_conversions.h" |
| 30 #include "ui/message_center/message_center.h" | 30 #include "ui/message_center/message_center.h" |
| 31 #include "ui/message_center/notification.h" | 31 #include "ui/message_center/notification.h" |
| 32 #include "ui/message_center/notification_delegate.h" | 32 #include "ui/message_center/notification_delegate.h" |
| 33 #include "ui/message_center/notification_list.h" | 33 #include "ui/message_center/notification_list.h" |
| 34 #include "ui/wm/core/coordinate_conversion.h" | 34 #include "ui/wm/core/coordinate_conversion.h" |
| 35 | 35 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 66 | 66 |
| 67 void ConvertPointFromScreenToNative(aura::WindowTreeHost* host, | 67 void ConvertPointFromScreenToNative(aura::WindowTreeHost* host, |
| 68 gfx::Point* point) { | 68 gfx::Point* point) { |
| 69 ::wm::ConvertPointFromScreen(host->window(), point); | 69 ::wm::ConvertPointFromScreen(host->window(), point); |
| 70 host->ConvertPointToNativeScreen(point); | 70 host->ConvertPointToNativeScreen(point); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 std::unique_ptr<MouseWarpController> CreateMouseWarpController( | 75 std::unique_ptr<MouseWarpController> CreateMouseWarpController( |
| 76 DisplayManager* manager, | 76 display::DisplayManager* manager, |
| 77 aura::Window* drag_source) { | 77 aura::Window* drag_source) { |
| 78 if (manager->IsInUnifiedMode() && manager->num_connected_displays() >= 2) | 78 if (manager->IsInUnifiedMode() && manager->num_connected_displays() >= 2) |
| 79 return base::MakeUnique<UnifiedMouseWarpController>(); | 79 return base::MakeUnique<UnifiedMouseWarpController>(); |
| 80 // Extra check for |num_connected_displays()| is for SystemDisplayApiTest | 80 // Extra check for |num_connected_displays()| is for SystemDisplayApiTest |
| 81 // that injects MockScreen. | 81 // that injects MockScreen. |
| 82 if (manager->GetNumDisplays() < 2 || manager->num_connected_displays() < 2) | 82 if (manager->GetNumDisplays() < 2 || manager->num_connected_displays() < 2) |
| 83 return base::MakeUnique<NullMouseWarpController>(); | 83 return base::MakeUnique<NullMouseWarpController>(); |
| 84 return base::MakeUnique<ExtendedMouseWarpController>(drag_source); | 84 return base::MakeUnique<ExtendedMouseWarpController>(drag_source); |
| 85 } | 85 } |
| 86 | 86 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 message_center::NotificationList::Notifications notifications = | 191 message_center::NotificationList::Notifications notifications = |
| 192 message_center::MessageCenter::Get()->GetVisibleNotifications(); | 192 message_center::MessageCenter::Get()->GetVisibleNotifications(); |
| 193 for (auto* const notification : notifications) { | 193 for (auto* const notification : notifications) { |
| 194 if (notification->id() == kDisplayErrorNotificationId) | 194 if (notification->id() == kDisplayErrorNotificationId) |
| 195 return notification->message(); | 195 return notification->message(); |
| 196 } | 196 } |
| 197 return base::string16(); | 197 return base::string16(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace ash | 200 } // namespace ash |
| OLD | NEW |