summaryrefslogtreecommitdiffstats
path: root/ash/system/web_notification/popup_bubble.h
blob: 3d4bd7a309c0870d87843ab8fd3730c274fc0cfa (plain)
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
// Copyright (c) 2012 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_NOTIFICATION_POPUP_BUBBLE_H_
#define ASH_SYSTEM_NOTIFICATION_POPUP_BUBBLE_H_

#include "ash/system/web_notification/web_notification_bubble.h"
#include "base/timer.h"

namespace ash {

class WebNotificationTray;

namespace message_center {

class PopupBubbleContentsView;

// Bubble for popup notifications.
class PopupBubble : public WebNotificationBubble {
 public:
  explicit PopupBubble(WebNotificationTray* tray);

  virtual ~PopupBubble();

  size_t NumMessageViewsForTest() const;

  // Overridden from TrayBubbleView::Host.
  virtual void BubbleViewDestroyed() OVERRIDE;

  virtual void OnMouseEnteredView() OVERRIDE;

  virtual void OnMouseExitedView() OVERRIDE;

 private:
  // Overridden from WebNotificationBubble.
  virtual void UpdateBubbleView() OVERRIDE;

  void StartAutoCloseTimer();

  void StopAutoCloseTimer();

  void OnAutoClose();

  base::OneShotTimer<PopupBubble> autoclose_;
  PopupBubbleContentsView* contents_view_;
  size_t num_popups_;

  DISALLOW_COPY_AND_ASSIGN(PopupBubble);
};

}  // namespace message_center

}  // namespace ash

#endif // ASH_SYSTEM_NOTIFICATION_POPUP_BUBBLE_H_