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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 2256983003: Check Content Window Visibility in DesktopNativeWidgetAura::IsVisible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Feedback Created 4 years, 4 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 | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 4e6799dbb2494a6437adbd3842ad60ce3d5d7bde..935a0f70b6bc31581a1029188e59b8215ce7dc58 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -746,6 +746,7 @@ void DesktopNativeWidgetAura::Hide() {
void DesktopNativeWidgetAura::ShowMaximizedWithBounds(
const gfx::Rect& restored_bounds) {
+ // IsVisible() should check the same objects here for visibility.
if (!content_window_)
return;
desktop_window_tree_host_->ShowMaximizedWithBounds(restored_bounds);
@@ -753,6 +754,7 @@ void DesktopNativeWidgetAura::ShowMaximizedWithBounds(
}
void DesktopNativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
+ // IsVisible() should check the same objects here for visibility.
if (!content_window_)
return;
desktop_window_tree_host_->ShowWindowWithState(state);
@@ -760,7 +762,13 @@ void DesktopNativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
}
bool DesktopNativeWidgetAura::IsVisible() const {
- return content_window_ && desktop_window_tree_host_->IsVisible();
+ // The objects checked here should be the same objects changed in
+ // ShowWithWindowState and ShowMaximizedWithBounds. For example, MS Windows
+ // platform code might show the desktop window tree host early, meaning we
+ // aren't fully visible as we haven't shown the content window. Callers may
+ // short-circuit a call to show this widget if they think its already visible.
+ return content_window_ && content_window_->IsVisible() &&
+ desktop_window_tree_host_->IsVisible();
}
void DesktopNativeWidgetAura::Activate() {
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698