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

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

Issue 2764733002: Add black background to ARC maximzied window (Closed)
Patch Set: ARC maximzied window should also have a black background Created 3 years, 9 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 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 window->AddChild(shadow_underlay_); 1612 window->AddChild(shadow_underlay_);
1613 window->StackChildAtBottom(shadow_underlay_); 1613 window->StackChildAtBottom(shadow_underlay_);
1614 } 1614 }
1615 } 1615 }
1616 1616
1617 bool underlay_capture_events = 1617 bool underlay_capture_events =
1618 WMHelper::GetInstance()->IsSpokenFeedbackEnabled() && 1618 WMHelper::GetInstance()->IsSpokenFeedbackEnabled() &&
1619 widget_->IsActive(); 1619 widget_->IsActive();
1620 1620
1621 float shadow_underlay_opacity = shadow_background_opacity_; 1621 float shadow_underlay_opacity = shadow_background_opacity_;
1622
1622 // Put the black background layer behind the window if 1623 // Put the black background layer behind the window if
1623 // 1) the window is in immersive fullscreen or is active with 1624 // 1) the window is in immersive fullscreen, maximized or is active with
1624 // spoken feedback enabled. 1625 // spoken feedback enabled.
1625 // 2) the window can control the bounds of the window in fullscreen ( 1626 // 2) the window can control the bounds of the window in fullscreen (
1626 // thus the background can be visible). 1627 // thus the background can be visible).
1627 // 3) the window has no transform (the transformed background may 1628 // 3) the window has no transform (the transformed background may
1628 // not cover the entire background, e.g. overview mode). 1629 // not cover the entire background, e.g. overview mode).
1629 if ((widget_->IsFullscreen() || underlay_capture_events) && 1630 if ((widget_->IsFullscreen() || widget_->IsMaximized() ||
1631 underlay_capture_events) &&
1630 ash::wm::GetWindowState(window)->allow_set_bounds_in_maximized() && 1632 ash::wm::GetWindowState(window)->allow_set_bounds_in_maximized() &&
1631 window->layer()->GetTargetTransform().IsIdentity()) { 1633 window->layer()->GetTargetTransform().IsIdentity()) {
1632 if (shadow_underlay_in_surface_) { 1634 if (shadow_underlay_in_surface_) {
1633 shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size()); 1635 shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size());
1634 } else { 1636 } else {
1635 gfx::Point origin; 1637 gfx::Point origin;
1636 origin -= window->bounds().origin().OffsetFromOrigin(); 1638 origin -= window->bounds().origin().OffsetFromOrigin();
1637 shadow_bounds.set_origin(origin); 1639 shadow_bounds.set_origin(origin);
1638 shadow_bounds.set_size(window->parent()->bounds().size()); 1640 shadow_bounds.set_size(window->parent()->bounds().size());
1639 } 1641 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 gfx::Point ShellSurface::GetMouseLocation() const { 1698 gfx::Point ShellSurface::GetMouseLocation() const {
1697 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1699 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1698 gfx::Point location = 1700 gfx::Point location =
1699 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1701 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1700 aura::Window::ConvertPointToTarget( 1702 aura::Window::ConvertPointToTarget(
1701 root_window, widget_->GetNativeWindow()->parent(), &location); 1703 root_window, widget_->GetNativeWindow()->parent(), &location);
1702 return location; 1704 return location;
1703 } 1705 }
1704 1706
1705 } // namespace exo 1707 } // 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