summaryrefslogtreecommitdiff
path: root/chromium/components/exo/surface_observer.h
blob: 078d29d6663b8c430b0969c269b9ced9c70335d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2015 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.

#ifndef COMPONENTS_EXO_SURFACE_OBSERVER_H_
#define COMPONENTS_EXO_SURFACE_OBSERVER_H_

namespace exo {
class Surface;

// Observers can listen to various events on the Surfaces.
class SurfaceObserver {
 public:
  // Called at the top of the surface's destructor, to give observers a
  // chance to remove themselves.
  virtual void OnSurfaceDestroying(Surface* surface) = 0;

  // Called when the occlusion of the aura window corresponding to |surface|
  // changes.
  virtual void OnWindowOcclusionChanged(Surface* surface) {}

  // Called on each commit.
  virtual void OnCommit(Surface* surface) {}

 protected:
  virtual ~SurfaceObserver() {}
};

}  // namespace exo

#endif  // COMPONENTS_EXO_SURFACE_OBSERVER_H_