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

Side by Side Diff: ash/mus/bridge/workspace_event_handler_mus.cc

Issue 2632543003: Refactor and push window properties up to class properties. (Closed)
Patch Set: More build fixes Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/mus/bridge/workspace_event_handler_mus.h" 5 #include "ash/mus/bridge/workspace_event_handler_mus.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/aura/window_property.h" 8 #include "ui/base/class_property.h"
9 9
10 DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::WorkspaceEventHandlerMus*); 10 DECLARE_UI_CLASS_PROPERTY_TYPE(ash::mus::WorkspaceEventHandlerMus*);
11 11
12 namespace { 12 namespace {
13 13
14 DEFINE_WINDOW_PROPERTY_KEY(ash::mus::WorkspaceEventHandlerMus*, 14 DEFINE_UI_CLASS_PROPERTY_KEY(ash::mus::WorkspaceEventHandlerMus*,
15 kWorkspaceEventHandlerProperty, 15 kWorkspaceEventHandlerProperty,
16 nullptr); 16 nullptr);
17 17
18 } // namespace 18 } // namespace
19 19
20 namespace ash { 20 namespace ash {
21 namespace mus { 21 namespace mus {
22 22
23 WorkspaceEventHandlerMus::WorkspaceEventHandlerMus( 23 WorkspaceEventHandlerMus::WorkspaceEventHandlerMus(
24 aura::Window* workspace_window) 24 aura::Window* workspace_window)
25 : workspace_window_(workspace_window) { 25 : workspace_window_(workspace_window) {
26 workspace_window_->SetProperty(kWorkspaceEventHandlerProperty, this); 26 workspace_window_->SetProperty(kWorkspaceEventHandlerProperty, this);
27 } 27 }
28 28
29 WorkspaceEventHandlerMus::~WorkspaceEventHandlerMus() { 29 WorkspaceEventHandlerMus::~WorkspaceEventHandlerMus() {
30 workspace_window_->ClearProperty(kWorkspaceEventHandlerProperty); 30 workspace_window_->ClearProperty(kWorkspaceEventHandlerProperty);
31 } 31 }
32 32
33 // static 33 // static
34 WorkspaceEventHandlerMus* WorkspaceEventHandlerMus::Get(aura::Window* window) { 34 WorkspaceEventHandlerMus* WorkspaceEventHandlerMus::Get(aura::Window* window) {
35 return window->GetProperty(kWorkspaceEventHandlerProperty); 35 return window->GetProperty(kWorkspaceEventHandlerProperty);
36 } 36 }
37 37
38 } // namespace mus 38 } // namespace mus
39 } // namespace ash 39 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698