Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: components/exo/shell_surface.cc

Issue 2870613002: Use defualt shadow elevation. (Closed)
Patch Set: update unit tests to use DEFAULT Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 ((widget_->IsFullscreen() || widget_->IsMaximized()) || 1586 ((widget_->IsFullscreen() || widget_->IsMaximized()) ||
1587 underlay_capture_events) && 1587 underlay_capture_events) &&
1588 ash::wm::GetWindowState(window)->allow_set_bounds_direct() && 1588 ash::wm::GetWindowState(window)->allow_set_bounds_direct() &&
1589 window->layer()->GetTargetTransform().IsIdentity(); 1589 window->layer()->GetTargetTransform().IsIdentity();
1590 1590
1591 if (!shadow_enabled_ && !black_background_enabled) { 1591 if (!shadow_enabled_ && !black_background_enabled) {
1592 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); 1592 wm::SetShadowElevation(window, wm::ShadowElevation::NONE);
1593 if (shadow_underlay_) 1593 if (shadow_underlay_)
1594 shadow_underlay_->Hide(); 1594 shadow_underlay_->Hide();
1595 } else { 1595 } else {
1596 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); 1596 wm::SetShadowElevation(window, wm::ShadowElevation::DEFAULT);
1597 gfx::Rect shadow_content_bounds = 1597 gfx::Rect shadow_content_bounds =
1598 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); 1598 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_);
1599 1599
1600 // Convert from screen to display coordinates. 1600 // Convert from screen to display coordinates.
1601 if (!shadow_content_bounds.IsEmpty()) { 1601 if (!shadow_content_bounds.IsEmpty()) {
1602 gfx::Point origin = shadow_content_bounds.origin() - origin_offset_; 1602 gfx::Point origin = shadow_content_bounds.origin() - origin_offset_;
1603 wm::ConvertPointFromScreen(window->parent(), &origin); 1603 wm::ConvertPointFromScreen(window->parent(), &origin);
1604 shadow_content_bounds.set_origin(origin); 1604 shadow_content_bounds.set_origin(origin);
1605 } 1605 }
1606 1606
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 gfx::Point ShellSurface::GetMouseLocation() const { 1736 gfx::Point ShellSurface::GetMouseLocation() const {
1737 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1737 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1738 gfx::Point location = 1738 gfx::Point location =
1739 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1739 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1740 aura::Window::ConvertPointToTarget( 1740 aura::Window::ConvertPointToTarget(
1741 root_window, widget_->GetNativeWindow()->parent(), &location); 1741 root_window, widget_->GetNativeWindow()->parent(), &location);
1742 return location; 1742 return location;
1743 } 1743 }
1744 1744
1745 } // namespace exo 1745 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698