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

Unified Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2493653002: Fixes DesktopWindowTreeHostMus::SetSize and IsVisible (Closed)
Patch Set: moar Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/desktop_window_tree_host_mus.cc
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc
index 9731c9d9179ff015fb8372768ecfac04c951c7e4..d5464b6a1561081aa1d368c5041d8e612e43043c 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -122,12 +122,23 @@ void DesktopWindowTreeHostMus::ShowMaximizedWithBounds(
}
bool DesktopWindowTreeHostMus::IsVisible() const {
- return window()->IsVisible();
+ // Go through the DesktopNativeWidgetAura::IsVisible() for checking
+ // visibility of the parent as it has additional checks beyond checking the
+ // aura::Window.
+ return window()->IsVisible() &&
+ (!parent_ ||
+ static_cast<const internal::NativeWidgetPrivate*>(
+ parent_->desktop_native_widget_aura_)
+ ->IsVisible());
}
void DesktopWindowTreeHostMus::SetSize(const gfx::Size& size) {
- // TODO: handle device scale, http://crbug.com/663524.
- SetBounds(gfx::Rect(window()->bounds().origin(), size));
+ // Use GetBounds() as the origin of window() is always at 0, 0.
+ gfx::Rect screen_bounds = GetBounds();
+ // TODO: handle device scale, http://crbug.com/663524. Also, |screen_bounds|
+ // is in pixels and should be dip.
+ screen_bounds.set_size(size);
+ SetBounds(screen_bounds);
}
void DesktopWindowTreeHostMus::StackAbove(aura::Window* window) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698