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

Unified Diff: components/exo/shell_surface.cc

Issue 2345043002: arc: Prevent showing Arc app window for secondary user profile. (Closed)
Patch Set: Created 4 years, 3 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
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 6248a27c13212c96588327d4db216d9844e79d12..0181bf1bba2303004d059741240a87ddb00a8c99 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -253,6 +253,7 @@ ShellSurface::ScopedAnimationsDisabled::~ScopedAnimationsDisabled() {
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(std::string*, kApplicationIdKey, nullptr)
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Surface*, kMainSurfaceKey, nullptr)
+DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kShelfWindowReady, false)
ShellSurface::ShellSurface(Surface* surface,
ShellSurface* parent,
@@ -463,6 +464,16 @@ const std::string ShellSurface::GetApplicationId(aura::Window* window) {
return string_ptr ? *string_ptr : std::string();
}
+// static
+bool ShellSurface::IsApplicationWindowReadyPropertyKey(const void* key) {
+ return kShelfWindowReady == key;
+}
+
+// static
+bool ShellSurface::IsApplicationWindowReadyToShow(aura::Window* window) {
+ return window->GetProperty(kShelfWindowReady);
+}
+
void ShellSurface::SetApplicationId(const std::string& application_id) {
TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id",
application_id);
@@ -622,8 +633,9 @@ void ShellSurface::OnSurfaceCommit() {
if (pending_show_widget_) {
DCHECK(!widget_->IsClosed());
DCHECK(!widget_->IsVisible());
+ DCHECK(!widget_->GetNativeWindow());
pending_show_widget_ = false;
- widget_->Show();
+ widget_->GetNativeWindow()->SetProperty(kShelfWindowReady, true);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698