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

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

Issue 2872203002: Use default shadow elevation. (Closed)
Patch Set: Use default shadow elevation. 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/common/frame/custom_frame_view_ash.h" 9 #include "ash/common/frame/custom_frame_view_ash.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 ((widget_->IsFullscreen() || widget_->IsMaximized()) || 1480 ((widget_->IsFullscreen() || widget_->IsMaximized()) ||
1481 underlay_capture_events) && 1481 underlay_capture_events) &&
1482 ash::wm::GetWindowState(window)->allow_set_bounds_direct() && 1482 ash::wm::GetWindowState(window)->allow_set_bounds_direct() &&
1483 window->layer()->GetTargetTransform().IsIdentity(); 1483 window->layer()->GetTargetTransform().IsIdentity();
1484 1484
1485 if (!shadow_enabled_ && !black_background_enabled) { 1485 if (!shadow_enabled_ && !black_background_enabled) {
1486 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); 1486 wm::SetShadowElevation(window, wm::ShadowElevation::NONE);
1487 if (shadow_underlay_) 1487 if (shadow_underlay_)
1488 shadow_underlay_->Hide(); 1488 shadow_underlay_->Hide();
1489 } else { 1489 } else {
1490 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); 1490 wm::SetShadowElevation(window, wm::ShadowElevation::DEFAULT);
1491 gfx::Rect shadow_content_bounds = 1491 gfx::Rect shadow_content_bounds =
1492 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); 1492 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_);
1493 1493
1494 // Convert from screen to display coordinates. 1494 // Convert from screen to display coordinates.
1495 if (!shadow_content_bounds.IsEmpty()) { 1495 if (!shadow_content_bounds.IsEmpty()) {
1496 gfx::Point origin = shadow_content_bounds.origin() - origin_offset_; 1496 gfx::Point origin = shadow_content_bounds.origin() - origin_offset_;
1497 wm::ConvertPointFromScreen(window->parent(), &origin); 1497 wm::ConvertPointFromScreen(window->parent(), &origin);
1498 shadow_content_bounds.set_origin(origin); 1498 shadow_content_bounds.set_origin(origin);
1499 } 1499 }
1500 1500
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 // small style shadow for them. 1621 // small style shadow for them.
1622 if (!activatable_) 1622 if (!activatable_)
1623 shadow->SetElevation(wm::ShadowElevation::SMALL); 1623 shadow->SetElevation(wm::ShadowElevation::SMALL);
1624 // We don't have rounded corners unless frame is enabled. 1624 // We don't have rounded corners unless frame is enabled.
1625 if (!frame_enabled_) 1625 if (!frame_enabled_)
1626 shadow->SetRoundedCornerRadius(0); 1626 shadow->SetRoundedCornerRadius(0);
1627 } 1627 }
1628 } 1628 }
1629 1629
1630 } // namespace exo 1630 } // 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