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

Unified Diff: components/exo/shell_surface.cc

Issue 2743053002: arc: Fix race condition in applying modal state. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/shell_surface.h ('k') | no next file » | 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 00a36dafe34afe065a4edb1d2dce8b858e4dc83e..8c0cd6230176fb8f0b08b07168351f295c2b261f 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -496,9 +496,17 @@ void ShellSurface::SetSystemModal(bool system_modal) {
<< "Only a window in SystemModalContainer can change the modality";
return;
}
+
+ system_modal_ = system_modal;
reveman 2017/03/10 21:38:22 should we return early if it didn't change?
khmel 2017/03/10 22:11:32 Done.
+ if (!widget_) {
+ LOG(WARNING) << "Skip setting system modal state to " << system_modal_
reveman 2017/03/10 21:38:22 We shouldn't LOG things that can be triggered by a
khmel 2017/03/10 22:11:32 Done.
+ << " because window is not ready yet.";
+ return;
+ }
+
widget_->GetNativeWindow()->SetProperty(
aura::client::kModalKey,
- system_modal ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE);
+ system_modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE);
}
reveman 2017/03/10 21:38:22 Please add a private UpdateSystemModal() function
khmel 2017/03/10 22:11:32 Done.
// static
@@ -766,6 +774,8 @@ void ShellSurface::OnSurfaceCommit() {
DCHECK(!widget_->IsVisible());
pending_show_widget_ = false;
widget_->Show();
+ if (system_modal_)
reveman 2017/03/10 21:38:22 Please replace these two lines with a call to Upda
khmel 2017/03/10 22:11:32 Done.
+ SetSystemModal(true);
}
}
}
« no previous file with comments | « components/exo/shell_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698