| 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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
| 10 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 break; | 1470 break; |
| 1471 } | 1471 } |
| 1472 | 1472 |
| 1473 // Set |ignore_window_bounds_changes_| as this change to window bounds | 1473 // Set |ignore_window_bounds_changes_| as this change to window bounds |
| 1474 // should not result in a configure request. | 1474 // should not result in a configure request. |
| 1475 DCHECK(!ignore_window_bounds_changes_); | 1475 DCHECK(!ignore_window_bounds_changes_); |
| 1476 ignore_window_bounds_changes_ = true; | 1476 ignore_window_bounds_changes_ = true; |
| 1477 const gfx::Rect widget_bounds = widget_->GetWindowBoundsInScreen(); | 1477 const gfx::Rect widget_bounds = widget_->GetWindowBoundsInScreen(); |
| 1478 if (widget_bounds != new_widget_bounds) { | 1478 if (widget_bounds != new_widget_bounds) { |
| 1479 if (bounds_mode_ != BoundsMode::CLIENT || !resizer_) { | 1479 if (bounds_mode_ != BoundsMode::CLIENT || !resizer_) { |
| 1480 // TODO(domlaskowski): Use screen coordinates once multi-display support | 1480 widget_->SetBounds(new_widget_bounds); |
| 1481 // lands in ARC. See crbug.com/718627. | |
| 1482 widget_->GetNativeWindow()->SetBounds(new_widget_bounds); | |
| 1483 UpdateSurfaceBounds(); | 1481 UpdateSurfaceBounds(); |
| 1484 } else { | 1482 } else { |
| 1485 // TODO(domlaskowski): Synchronize window state transitions with the | 1483 // TODO(domlaskowski): Synchronize window state transitions with the |
| 1486 // client, and abort client-side dragging on transition to fullscreen. See | 1484 // client, and abort client-side dragging on transition to fullscreen. See |
| 1487 // crbug.com/699746. | 1485 // crbug.com/699746. |
| 1488 DLOG_IF(ERROR, widget_bounds.size() != new_widget_bounds.size()) | 1486 DLOG_IF(ERROR, widget_bounds.size() != new_widget_bounds.size()) |
| 1489 << "Window size changed during client-driven drag"; | 1487 << "Window size changed during client-driven drag"; |
| 1490 | 1488 |
| 1491 // Convert from screen to display coordinates. | 1489 // Convert from screen to display coordinates. |
| 1492 gfx::Point origin = new_widget_bounds.origin(); | 1490 gfx::Point origin = new_widget_bounds.origin(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 gfx::Point ShellSurface::GetMouseLocation() const { | 1659 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1662 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1660 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1663 gfx::Point location = | 1661 gfx::Point location = |
| 1664 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1662 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1665 aura::Window::ConvertPointToTarget( | 1663 aura::Window::ConvertPointToTarget( |
| 1666 root_window, widget_->GetNativeWindow()->parent(), &location); | 1664 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1667 return location; | 1665 return location; |
| 1668 } | 1666 } |
| 1669 | 1667 |
| 1670 } // namespace exo | 1668 } // namespace exo |
| OLD | NEW |