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

Unified Diff: ash/mus/bridge/workspace_event_handler_mus.cc

Issue 2285703003: Moves WorkspaceEventHandler to ash/common (Closed)
Patch Set: merge 2 trunk 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 | « ash/mus/bridge/workspace_event_handler_mus.h ('k') | ash/mus/move_event_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/mus/bridge/workspace_event_handler_mus.h ('k') | ash/mus/move_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698