summaryrefslogtreecommitdiffstats
path: root/ui/views/animation/ink_drop_host.h
blob: 570f2710b4913ff3c2b4b659dff16f2fb07448d9 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// 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 UI_VIEWS_ANIMATION_INK_DROP_HOST_H_
#define UI_VIEWS_ANIMATION_INK_DROP_HOST_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/geometry/point.h"
#include "ui/views/views_export.h"

namespace ui {
class Layer;
}  // namespace ui

namespace views {

class InkDropAnimation;
class InkDropHover;

// Used by the InkDropAnimationController to add and remove the ink drop layers
// from a host's layer tree. Typically the ink drop layer is added to a View's
// layer but it can also be added to a View's ancestor layer.
//
// Note: Some Views do not own a Layer, but you can use
// View::SetLayer(new ui::Layer(ui::LAYER_NOT_DRAWN)) to force the View to have
// a lightweight Layer that can parent the ink drop layer.
class VIEWS_EXPORT InkDropHost {
 public:
  InkDropHost() {}
  virtual ~InkDropHost() {}

  // Adds the |ink_drop_layer| in to a visible layer tree.
  virtual void AddInkDropLayer(ui::Layer* ink_drop_layer) = 0;

  // Removes |ink_drop_layer| from the layer tree.
  virtual void RemoveInkDropLayer(ui::Layer* ink_drop_layer) = 0;

  // Creates and returns the effect used for press.
  virtual scoped_ptr<InkDropAnimation> CreateInkDropAnimation() const = 0;

  // Creates and returns the effect used for hover.
  virtual scoped_ptr<InkDropHover> CreateInkDropHover() const = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(InkDropHost);
};

}  // namespace views

#endif  // UI_VIEWS_ANIMATION_INK_DROP_HOST_H_