forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunified_media_controls_container.h
43 lines (30 loc) · 1.23 KB
/
unified_media_controls_container.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
// Copyright 2020 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_SYSTEM_MEDIA_UNIFIED_MEDIA_CONTROLS_CONTAINER_H_
#define ASH_SYSTEM_MEDIA_UNIFIED_MEDIA_CONTROLS_CONTAINER_H_
#include "ui/views/view.h"
namespace ash {
// Container view of UnifiedMediaControlsView. This manages the
// visibility and expanded amount of the entire media controls view.
class UnifiedMediaControlsContainer : public views::View {
public:
UnifiedMediaControlsContainer();
~UnifiedMediaControlsContainer() override = default;
// Set |should_show_media_controls_|.
void SetShouldShowMediaControls(bool should_show);
// Show media controls if necessary. Returns true if media controls
// will be shown.
bool MaybeShowMediaControls();
// Set |expanded_amount_| and hide/show media controls correspondingly.
void SetExpandedAmount(double expanded_amount);
int GetExpandedHeight() const;
// views::View
void Layout() override;
gfx::Size CalculatePreferredSize() const override;
private:
double expanded_amount_;
bool should_show_media_controls_;
};
} // namespace ash
#endif // ASH_SYSTEM_MEDIA_UNIFIED_MEDIA_CONTROLS_CONTAINER_H_