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

Unified Diff: components/exo/shell_surface.cc

Issue 2189073003: Add configuration_changed event and set_background_opacity request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 0f0c8a65bdda247291e03b7cdd5f4d8991ffff57..d31e8b56afe5384620960d6db635bdcda99a6859 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -487,6 +487,13 @@ void ShellSurface::SetRectangularShadow(const gfx::Rect& content_bounds) {
shadow_content_bounds_ = content_bounds;
}
+void ShellSurface::SetRectangularShadowBackgroundOpacity(float opacity) {
+ TRACE_EVENT1("exo", "ShellSurface::SetRectangularShadowBackgroundOpacity",
+ "opacity", opacity);
+
+ rectangular_shadow_background_opacity_ = opacity;
+}
+
void ShellSurface::SetScale(double scale) {
TRACE_EVENT1("exo", "ShellSurface::SetScale", "scale", scale);
@@ -1186,20 +1193,15 @@ void ShellSurface::UpdateShadow() {
shadow_underlay_->Hide();
} else {
wm::SetShadowType(window, wm::SHADOW_TYPE_RECTANGULAR);
- wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window);
- // Maximized/Fullscreen window does not create a shadow.
- if (!shadow)
- return;
- if (!shadow_overlay_) {
- shadow_overlay_ = new aura::Window(nullptr);
- DCHECK(shadow_overlay_->owned_by_parent());
- shadow_overlay_->set_ignore_events(true);
- shadow_overlay_->Init(ui::LAYER_NOT_DRAWN);
- shadow_overlay_->layer()->Add(shadow->layer());
- window->AddChild(shadow_overlay_);
- shadow_overlay_->Show();
- }
+ // TODO(oshima): Adjust the coordinates from client screen to
+ // chromeos screen when multi displays are supported.
+ gfx::Point origin = window->bounds().origin();
+ gfx::Point shadow_origin = shadow_content_bounds_.origin();
+ shadow_origin -= origin.OffsetFromOrigin();
+ gfx::Rect shadow_bounds(shadow_origin, shadow_content_bounds_.size());
+
+ // Always create and show the underlay, even in maximized/fullscreen.
if (!shadow_underlay_) {
shadow_underlay_ = new aura::Window(nullptr);
DCHECK(shadow_underlay_->owned_by_parent());
@@ -1214,17 +1216,26 @@ void ShellSurface::UpdateShadow() {
window->AddChild(shadow_underlay_);
window->StackChildAtBottom(shadow_underlay_);
}
+ shadow_underlay_->layer()->SetOpacity(
+ rectangular_shadow_background_opacity_);
+ shadow_underlay_->SetBounds(shadow_bounds);
shadow_underlay_->Show();
- // TODO(oshima): Adjust the coordinates from client screen to
- // chromeos screen when multi displays are support.
- gfx::Point origin = window->bounds().origin();
- gfx::Point shadow_origin = shadow_content_bounds_.origin();
- shadow_origin -= origin.OffsetFromOrigin();
- gfx::Rect shadow_bounds(shadow_origin, shadow_content_bounds_.size());
+ wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window);
+ // Maximized/Fullscreen window does not create a shadow.
+ if (!shadow)
+ return;
+ if (!shadow_overlay_) {
+ shadow_overlay_ = new aura::Window(nullptr);
+ DCHECK(shadow_overlay_->owned_by_parent());
+ shadow_overlay_->set_ignore_events(true);
+ shadow_overlay_->Init(ui::LAYER_NOT_DRAWN);
+ shadow_overlay_->layer()->Add(shadow->layer());
+ window->AddChild(shadow_overlay_);
+ shadow_overlay_->Show();
+ }
shadow_overlay_->SetBounds(shadow_bounds);
- shadow_underlay_->SetBounds(shadow_bounds);
shadow->SetContentBounds(gfx::Rect(shadow_bounds.size()));
}
}
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698