summaryrefslogtreecommitdiffstats
path: root/ash/wm/dim_window.h
blob: 8d86c63d02dbeba44449d2a25a40698ce950a786 (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
32
33
34
35
// 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.

#include "ash/ash_export.h"
#include "base/macros.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"

namespace ash {

// A window used to dim the child windows of the given container.
class ASH_EXPORT DimWindow : public aura::Window, public aura::WindowObserver {
 public:
  // Return a dim window for the container if any, or nullptr.
  static DimWindow* Get(aura::Window* container);

  explicit DimWindow(aura::Window* parent);
  ~DimWindow() override;

  void SetDimOpacity(float target_opacity);

  // aura::WindowObserver:
  void OnWindowBoundsChanged(aura::Window* window,
                             const gfx::Rect& old_bounds,
                             const gfx::Rect& new_bounds) override;
  void OnWindowDestroying(aura::Window* window) override;

 private:
  aura::Window* parent_;

  DISALLOW_COPY_AND_ASSIGN(DimWindow);
};

}  // namespace ash