forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlock_screen_action_background_view.h
64 lines (48 loc) · 2.05 KB
/
lock_screen_action_background_view.h
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
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2017 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 ASH_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_BACKGROUND_VIEW_H_
#define ASH_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_BACKGROUND_VIEW_H_
#include "ash/ash_export.h"
#include "base/callback_forward.h"
#include "ui/views/animation/ink_drop_observer.h"
#include "ui/views/animation/ink_drop_state.h"
#include "ui/views/widget/widget_delegate.h"
namespace ash {
// Widget delegate view that implements the contents of the lock action
// background widget.
// The widget hosts a view that contains a transparent view with a black ink
// drop. The view implementation provides methods to activate or hide the ink
// drop in the view.
class ASH_EXPORT LockScreenActionBackgroundView
: public views::WidgetDelegateView,
public views::InkDropObserver {
public:
LockScreenActionBackgroundView();
LockScreenActionBackgroundView(const LockScreenActionBackgroundView&) =
delete;
LockScreenActionBackgroundView& operator=(
const LockScreenActionBackgroundView&) = delete;
~LockScreenActionBackgroundView() override;
// Request the ink drop to be activated.
// |done| - called when the ink drop animation ends.
void AnimateShow(base::OnceClosure done);
// Requests the ink drop to be hidden.
// |done| - called when the ink drop animation ends.
void AnimateHide(base::OnceClosure done);
// views::InkDropListener:
void InkDropAnimationStarted() override;
void InkDropRippleAnimationEnded(views::InkDropState state) override;
// views::WidgetDelegateView:
bool CanActivate() const override;
private:
friend class LockScreenActionBackgroundViewTestApi;
class NoteBackground;
// Gets background_ as a views::View*.
views::View* GetBackgroundView();
base::OnceClosure animation_end_callback_;
views::InkDropState animating_to_state_;
NoteBackground* background_ = nullptr;
};
} // namespace ash
#endif // ASH_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_BACKGROUND_VIEW_H_