forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshelf_tooltip_preview_bubble.h
65 lines (49 loc) · 2.02 KB
/
shelf_tooltip_preview_bubble.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
65
// Copyright 2018 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_SHELF_SHELF_TOOLTIP_PREVIEW_BUBBLE_H_
#define ASH_SHELF_SHELF_TOOLTIP_PREVIEW_BUBBLE_H_
#include <vector>
#include "ash/ash_export.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/shelf/shelf_bubble.h"
#include "ash/shelf/shelf_tooltip_manager.h"
#include "ash/shelf/window_preview.h"
#include "ash/wm/window_mirror_view.h"
#include "base/timer/timer.h"
#include "ui/aura/window.h"
#include "ui/views/controls/label.h"
namespace ash {
// The implementation of tooltip bubbles for the shelf item.
class ASH_EXPORT ShelfTooltipPreviewBubble : public ShelfBubble,
public WindowPreview::Delegate {
public:
ShelfTooltipPreviewBubble(views::View* anchor,
const std::vector<aura::Window*>& windows,
ShelfTooltipManager* manager,
ShelfAlignment alignment,
SkColor background_color);
~ShelfTooltipPreviewBubble() override;
private:
// Removes the given preview from the list of previewed windows.
void RemovePreview(WindowPreview* preview);
// BubbleDialogDelegateView overrides:
gfx::Rect GetBubbleBounds() override;
void OnMouseExited(const ui::MouseEvent& event) override;
// ShelfBubble:
bool ShouldCloseOnPressDown() override;
bool ShouldCloseOnMouseExit() override;
// WindowPreview::Delegate:
float GetMaxPreviewRatio() const override;
void OnPreviewDismissed(WindowPreview* preview) override;
void OnPreviewActivated(WindowPreview* preview) override;
void DismissAfterDelay();
void Dismiss();
std::vector<WindowPreview*> previews_;
ShelfTooltipManager* manager_;
base::OneShotTimer dismiss_timer_;
const ShelfAlignment shelf_alignment_;
DISALLOW_COPY_AND_ASSIGN(ShelfTooltipPreviewBubble);
};
} // namespace ash
#endif // ASH_SHELF_SHELF_TOOLTIP_PREVIEW_BUBBLE_H_