| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mus/window_manager.h" | 5 #include "ash/mus/window_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 ui::mojom::PointerKind source) { | 394 ui::mojom::PointerKind source) { |
| 395 if (drag_image.isNull()) | 395 if (drag_image.isNull()) |
| 396 return; | 396 return; |
| 397 | 397 |
| 398 // TODO(erg): Get the right display for this drag image. Right now, none of | 398 // TODO(erg): Get the right display for this drag image. Right now, none of |
| 399 // the drag drop code is multidisplay aware. | 399 // the drag drop code is multidisplay aware. |
| 400 | 400 |
| 401 // TODO(erg): SkBitmap is the wrong data type for the drag image; we should | 401 // TODO(erg): SkBitmap is the wrong data type for the drag image; we should |
| 402 // be passing ImageSkias once http://crbug.com/655874 is implemented. | 402 // be passing ImageSkias once http://crbug.com/655874 is implemented. |
| 403 | 403 |
| 404 WmWindow* root_window = | 404 aura::Window* root_window = |
| 405 WmWindow::Get((*GetRootWindowControllers().begin())->GetRootWindow()); | 405 (*GetRootWindowControllers().begin())->GetRootWindow(); |
| 406 | 406 |
| 407 ui::DragDropTypes::DragEventSource ui_source = | 407 ui::DragDropTypes::DragEventSource ui_source = |
| 408 source == ui::mojom::PointerKind::MOUSE | 408 source == ui::mojom::PointerKind::MOUSE |
| 409 ? ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE | 409 ? ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE |
| 410 : ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH; | 410 : ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH; |
| 411 std::unique_ptr<DragImageView> drag_view = | 411 std::unique_ptr<DragImageView> drag_view = |
| 412 base::MakeUnique<DragImageView>(root_window, ui_source); | 412 base::MakeUnique<DragImageView>(root_window, ui_source); |
| 413 drag_view->SetImage(gfx::ImageSkia::CreateFrom1xBitmap(drag_image)); | 413 drag_view->SetImage(gfx::ImageSkia::CreateFrom1xBitmap(drag_image)); |
| 414 gfx::Size size = drag_view->GetPreferredSize(); | 414 gfx::Size size = drag_view->GetPreferredSize(); |
| 415 gfx::Rect drag_image_bounds(screen_location - drag_image_offset, size); | 415 gfx::Rect drag_image_bounds(screen_location - drag_image_offset, size); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 bool WindowManager::IsWindowActive(aura::Window* window) { | 560 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 561 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 561 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
| 562 } | 562 } |
| 563 | 563 |
| 564 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 564 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 565 Shell::Get()->activation_client()->DeactivateWindow(window); | 565 Shell::Get()->activation_client()->DeactivateWindow(window); |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace mus | 568 } // namespace mus |
| 569 } // namespace ash | 569 } // namespace ash |
| OLD | NEW |