| 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 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 ((widget_->IsFullscreen() || widget_->IsMaximized()) || | 1575 ((widget_->IsFullscreen() || widget_->IsMaximized()) || |
| 1576 underlay_capture_events) && | 1576 underlay_capture_events) && |
| 1577 ash::wm::GetWindowState(window)->allow_set_bounds_direct() && | 1577 ash::wm::GetWindowState(window)->allow_set_bounds_direct() && |
| 1578 window->layer()->GetTargetTransform().IsIdentity(); | 1578 window->layer()->GetTargetTransform().IsIdentity(); |
| 1579 | 1579 |
| 1580 if (!shadow_enabled_ && !black_background_enabled) { | 1580 if (!shadow_enabled_ && !black_background_enabled) { |
| 1581 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); | 1581 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); |
| 1582 if (shadow_underlay_) | 1582 if (shadow_underlay_) |
| 1583 shadow_underlay_->Hide(); | 1583 shadow_underlay_->Hide(); |
| 1584 } else { | 1584 } else { |
| 1585 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); | 1585 wm::SetShadowElevation(window, wm::ShadowElevation::DEFAULT); |
| 1586 gfx::Rect shadow_content_bounds = | 1586 gfx::Rect shadow_content_bounds = |
| 1587 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); | 1587 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); |
| 1588 | 1588 |
| 1589 // Convert from screen to display coordinates. | 1589 // Convert from screen to display coordinates. |
| 1590 if (!shadow_content_bounds.IsEmpty()) { | 1590 if (!shadow_content_bounds.IsEmpty()) { |
| 1591 gfx::Point origin = shadow_content_bounds.origin() - origin_offset_; | 1591 gfx::Point origin = shadow_content_bounds.origin() - origin_offset_; |
| 1592 wm::ConvertPointFromScreen(window->parent(), &origin); | 1592 wm::ConvertPointFromScreen(window->parent(), &origin); |
| 1593 shadow_content_bounds.set_origin(origin); | 1593 shadow_content_bounds.set_origin(origin); |
| 1594 } | 1594 } |
| 1595 | 1595 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1725 gfx::Point ShellSurface::GetMouseLocation() const { | 1725 gfx::Point ShellSurface::GetMouseLocation() const { |
| 1726 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1726 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
| 1727 gfx::Point location = | 1727 gfx::Point location = |
| 1728 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1728 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 1729 aura::Window::ConvertPointToTarget( | 1729 aura::Window::ConvertPointToTarget( |
| 1730 root_window, widget_->GetNativeWindow()->parent(), &location); | 1730 root_window, widget_->GetNativeWindow()->parent(), &location); |
| 1731 return location; | 1731 return location; |
| 1732 } | 1732 } |
| 1733 | 1733 |
| 1734 } // namespace exo | 1734 } // namespace exo |
| OLD | NEW |