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