| 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/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 break; | 1521 break; |
| 1522 } | 1522 } |
| 1523 | 1523 |
| 1524 // Set |ignore_window_bounds_changes_| as this change to window bounds | 1524 // Set |ignore_window_bounds_changes_| as this change to window bounds |
| 1525 // should not result in a configure request. | 1525 // should not result in a configure request. |
| 1526 DCHECK(!ignore_window_bounds_changes_); | 1526 DCHECK(!ignore_window_bounds_changes_); |
| 1527 ignore_window_bounds_changes_ = true; | 1527 ignore_window_bounds_changes_ = true; |
| 1528 const gfx::Rect widget_bounds = widget_->GetWindowBoundsInScreen(); | 1528 const gfx::Rect widget_bounds = widget_->GetWindowBoundsInScreen(); |
| 1529 if (widget_bounds != new_widget_bounds) { | 1529 if (widget_bounds != new_widget_bounds) { |
| 1530 if (bounds_mode_ != BoundsMode::CLIENT || !resizer_) { | 1530 if (bounds_mode_ != BoundsMode::CLIENT || !resizer_) { |
| 1531 widget_->SetBounds(new_widget_bounds); | 1531 widget_->GetNativeWindow()->SetBounds(new_widget_bounds); |
| 1532 UpdateSurfaceBounds(); | 1532 UpdateSurfaceBounds(); |
| 1533 } else { | 1533 } else { |
| 1534 // TODO(domlaskowski): Synchronize window state transitions with the | 1534 // TODO(domlaskowski): Synchronize window state transitions with the |
| 1535 // client, and abort client-side dragging on transition to fullscreen. See | 1535 // client, and abort client-side dragging on transition to fullscreen. See |
| 1536 // crbug.com/699746. | 1536 // crbug.com/699746. |
| 1537 DLOG_IF(ERROR, widget_bounds.size() != new_widget_bounds.size()) | 1537 DLOG_IF(ERROR, widget_bounds.size() != new_widget_bounds.size()) |
| 1538 << "Window size changed during client-driven drag"; | 1538 << "Window size changed during client-driven drag"; |
| 1539 | 1539 |
| 1540 // Convert from screen to display coordinates. | 1540 // Convert from screen to display coordinates. |
| 1541 gfx::Point origin = new_widget_bounds.origin(); | 1541 gfx::Point origin = new_widget_bounds.origin(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 gfx::Point ShellSurface::GetMouseLocation() const { | 1730 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1731 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1731 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1732 gfx::Point location = | 1732 gfx::Point location = |
| 1733 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1733 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1734 aura::Window::ConvertPointToTarget( | 1734 aura::Window::ConvertPointToTarget( |
| 1735 root_window, widget_->GetNativeWindow()->parent(), &location); | 1735 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1736 return location; | 1736 return location; |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 } // namespace exo | 1739 } // namespace exo |
| OLD | NEW |