Index: ash/mus/bridge/workspace_event_handler_mus.cc |
diff --git a/ash/mus/bridge/workspace_event_handler_mus.cc b/ash/mus/bridge/workspace_event_handler_mus.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a866c38107fff1c03b5d4b87a0527a4bc6d96bae |
--- /dev/null |
+++ b/ash/mus/bridge/workspace_event_handler_mus.cc |
@@ -0,0 +1,38 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ash/mus/bridge/workspace_event_handler_mus.h" |
+ |
+#include "services/ui/public/cpp/window.h" |
+#include "services/ui/public/cpp/window_property.h" |
+ |
+MUS_DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::WorkspaceEventHandlerMus*); |
+ |
+namespace { |
+ |
+MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ash::mus::WorkspaceEventHandlerMus*, |
+ kWorkspaceEventHandlerProperty, |
+ nullptr); |
+ |
+} // namespace |
+ |
+namespace ash { |
+namespace mus { |
+ |
+WorkspaceEventHandlerMus::WorkspaceEventHandlerMus(ui::Window* workspace_window) |
+ : workspace_window_(workspace_window) { |
+ workspace_window_->SetLocalProperty(kWorkspaceEventHandlerProperty, this); |
+} |
+ |
+WorkspaceEventHandlerMus::~WorkspaceEventHandlerMus() { |
+ workspace_window_->ClearLocalProperty(kWorkspaceEventHandlerProperty); |
+} |
+ |
+// static |
+WorkspaceEventHandlerMus* WorkspaceEventHandlerMus::Get(ui::Window* window) { |
+ return window->GetLocalProperty(kWorkspaceEventHandlerProperty); |
+} |
+ |
+} // namespace mus |
+} // namespace ash |