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

Side by Side Diff: ash/mus/disconnected_app_handler.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/disconnected_app_handler.h" 5 #include "ash/mus/disconnected_app_handler.h"
6 6
7 #include "ash/common/wm_window.h" 7 #include "ash/common/wm_window.h"
8 #include "ash/public/cpp/shell_window_ids.h" 8 #include "ash/public/cpp/shell_window_ids.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_property.h" 10 #include "ui/base/class_property.h"
11 11
12 DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::DisconnectedAppHandler*); 12 DECLARE_UI_CLASS_PROPERTY_TYPE(ash::mus::DisconnectedAppHandler*);
13 13
14 namespace ash { 14 namespace ash {
15 namespace mus { 15 namespace mus {
16 namespace { 16 namespace {
17 17
18 DEFINE_OWNED_WINDOW_PROPERTY_KEY(DisconnectedAppHandler, 18 DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(DisconnectedAppHandler,
19 kDisconnectedAppHandlerKey, 19 kDisconnectedAppHandlerKey,
20 nullptr); 20 nullptr);
21 21
22 } // namespace 22 } // namespace
23 23
24 // static 24 // static
25 void DisconnectedAppHandler::Create(aura::Window* window) { 25 void DisconnectedAppHandler::Create(aura::Window* window) {
26 window->SetProperty(kDisconnectedAppHandlerKey, 26 window->SetProperty(kDisconnectedAppHandlerKey,
27 new DisconnectedAppHandler(window)); 27 new DisconnectedAppHandler(window));
28 } 28 }
29 29
30 DisconnectedAppHandler::DisconnectedAppHandler(aura::Window* window) 30 DisconnectedAppHandler::DisconnectedAppHandler(aura::Window* window)
31 : window_(window) { 31 : window_(window) {
32 window->AddObserver(this); 32 window->AddObserver(this);
33 } 33 }
34 34
35 DisconnectedAppHandler::~DisconnectedAppHandler() { 35 DisconnectedAppHandler::~DisconnectedAppHandler() {
36 window_->RemoveObserver(this); 36 window_->RemoveObserver(this);
37 } 37 }
38 38
39 void DisconnectedAppHandler::OnEmbeddedAppDisconnected(aura::Window* window) { 39 void DisconnectedAppHandler::OnEmbeddedAppDisconnected(aura::Window* window) {
40 delete window_; 40 delete window_;
41 } 41 }
42 42
43 } // namespace mus 43 } // namespace mus
44 } // namespace ash 44 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698