overflow_bubble.h revision 424c4d7b64af9d0d8fd9624f381f469654d5e3d2
1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef ASH_SHELF_OVERFLOW_BUBBLE_H_
6#define ASH_SHELF_OVERFLOW_BUBBLE_H_
7
8#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "ui/views/widget/widget_observer.h"
11
12namespace views {
13class View;
14}
15
16namespace ash {
17
18class LauncherDelegate;
19class LauncherModel;
20
21namespace internal {
22
23class LauncherView;
24
25// OverflowBubble displays the overflown launcher items in a bubble.
26class OverflowBubble : public views::WidgetObserver {
27 public:
28  OverflowBubble();
29  virtual ~OverflowBubble();
30
31  // Shows an bubble pointing to |anchor| with |launcher_view| as its content.
32  void Show(views::View* anchor, LauncherView* launcher_view);
33
34  void Hide();
35
36  bool IsShowing() const { return !!bubble_; }
37  LauncherView* launcher_view() { return launcher_view_; }
38
39 private:
40  // Overridden from views::WidgetObserver:
41  virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
42
43  views::View* bubble_;  // Owned by views hierarchy.
44  LauncherView* launcher_view_;  // Owned by |bubble_|.
45
46  DISALLOW_COPY_AND_ASSIGN(OverflowBubble);
47};
48
49}  // namespace internal
50}  // namespace ash
51
52#endif  // ASH_SHELF_OVERFLOW_BUBBLE_H_
53