blob: ab79a77bc27ce52f430135b4830a240e353fb6ba [file] [log] [blame]
// 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.
#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 "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 {
ShelfTooltipPreviewBubble(views::View* anchor,
const std::vector<aura::Window*>& windows,
ShelfTooltipManager* manager,
ShelfAlignment alignment,
SkColor background_color);
~ShelfTooltipPreviewBubble() override;
// Removes the given preview from the list of previewed windows.
void RemovePreview(WindowPreview* preview);
// BubbleDialogDelegateView overrides:
gfx::Size CalculatePreferredSize() const override;
// ShelfBubble:
bool ShouldCloseOnPressDown() override;
bool ShouldCloseOnMouseExit() override;
// WindowPreview::Delegate:
void OnPreviewDismissed(WindowPreview* preview) override;
void OnPreviewActivated(WindowPreview* preview) override;
// views::View:
void Layout() override;
std::vector<WindowPreview*> previews_;
// Computed dimensions for the tooltip.
int width_ = 0;
int height_ = 0;
ShelfTooltipManager* manager_;
} // namespace ash