blob: 64fd6ba5587ed6d240fd87f616c8d29e951c8feb [file] [log] [blame]
sadrul0a064b92016-04-22 17:36:501// 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
Scott Violet4c79b0d2017-11-17 21:47:135#ifndef ASH_DISCONNECTED_APP_HANDLER_H_
6#define ASH_DISCONNECTED_APP_HANDLER_H_
sadrul0a064b92016-04-22 17:36:507
8#include "base/macros.h"
sky02b9d142017-01-13 04:16:199#include "ui/aura/window_observer.h"
sadrul0a064b92016-04-22 17:36:5010
sky002ba4a2016-06-03 00:56:1111namespace ash {
sadrul0a064b92016-04-22 17:36:5012
sky02b9d142017-01-13 04:16:1913// DisconnectedAppHandler is associated with a single aura Window and deletes
14// the window when the embedded app is disconnected. This is intended to be used
Scott Violet4c79b0d2017-11-17 21:47:1315// for windows created at the request of client apps. This is only used in mash.
sky02b9d142017-01-13 04:16:1916class DisconnectedAppHandler : public aura::WindowObserver {
sadrul0a064b92016-04-22 17:36:5017 public:
sky02b9d142017-01-13 04:16:1918 // Public for WindowProperty.
sadrul0a064b92016-04-22 17:36:5019 ~DisconnectedAppHandler() override;
20
sky02b9d142017-01-13 04:16:1921 // Creates a new DisconnectedAppHandler associated with |window|.
22 // DisconnectedAppHandler is owned by the window.
23 static void Create(aura::Window* window);
24
sadrul0a064b92016-04-22 17:36:5025 private:
sky02b9d142017-01-13 04:16:1926 explicit DisconnectedAppHandler(aura::Window* root_window);
27
skyfcf18b52016-12-06 03:53:5128 // aura::WindowObserver:
29 void OnEmbeddedAppDisconnected(aura::Window* window) override;
sky02b9d142017-01-13 04:16:1930
31 aura::Window* window_;
sadrul0a064b92016-04-22 17:36:5032
33 DISALLOW_COPY_AND_ASSIGN(DisconnectedAppHandler);
34};
35
sky002ba4a2016-06-03 00:56:1136} // namespace ash
sadrul0a064b92016-04-22 17:36:5037
Scott Violet4c79b0d2017-11-17 21:47:1338#endif // ASH_DISCONNECTED_APP_HANDLER_H_