OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/mus/bridge/workspace_event_handler_mus.h" |
| 6 |
| 7 #include "services/ui/public/cpp/window.h" |
| 8 #include "services/ui/public/cpp/window_property.h" |
| 9 |
| 10 MUS_DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::WorkspaceEventHandlerMus*); |
| 11 |
| 12 namespace { |
| 13 |
| 14 MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ash::mus::WorkspaceEventHandlerMus*, |
| 15 kWorkspaceEventHandlerProperty, |
| 16 nullptr); |
| 17 |
| 18 } // namespace |
| 19 |
| 20 namespace ash { |
| 21 namespace mus { |
| 22 |
| 23 WorkspaceEventHandlerMus::WorkspaceEventHandlerMus(ui::Window* workspace_window) |
| 24 : workspace_window_(workspace_window) { |
| 25 workspace_window_->SetLocalProperty(kWorkspaceEventHandlerProperty, this); |
| 26 } |
| 27 |
| 28 WorkspaceEventHandlerMus::~WorkspaceEventHandlerMus() { |
| 29 workspace_window_->ClearLocalProperty(kWorkspaceEventHandlerProperty); |
| 30 } |
| 31 |
| 32 // static |
| 33 WorkspaceEventHandlerMus* WorkspaceEventHandlerMus::Get(ui::Window* window) { |
| 34 return window->GetLocalProperty(kWorkspaceEventHandlerProperty); |
| 35 } |
| 36 |
| 37 } // namespace mus |
| 38 } // namespace ash |
OLD | NEW |