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

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

Issue 2493653002: Fixes DesktopWindowTreeHostMus::SetSize and IsVisible (Closed)
Patch Set: feedback 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..77c69889bd6b70890225a78c91bc20162825e42d 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -122,12 +122,20 @@ void DesktopWindowTreeHostMus::ShowMaximizedWithBounds(
}
bool DesktopWindowTreeHostMus::IsVisible() const {
+ // Go through the Widget api for checking visibility as it has additional
msw 2016/11/10 01:33:56 Hmm, Widget::IsVisible() just returns |native_widg
sky 2016/11/10 05:44:46 Good call. fixed!
+ // checks beyond checking the aura::Window.
+ if (parent_ && !parent_->native_widget_delegate_->AsWidget()->IsVisible())
+ return false;
return window()->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