Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: ui/message_center/message_popup_bubble.h

Issue 12082081: Sets per-item timers rather than global timer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/message_center/message_popup_bubble.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_ 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_
6 #define UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_ 6 #define UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_
7 7
8 #include <map>
9 #include <set>
10 #include <string>
11
8 #include "base/timer.h" 12 #include "base/timer.h"
9 #include "ui/message_center/message_bubble_base.h" 13 #include "ui/message_center/message_bubble_base.h"
10 #include "ui/message_center/message_center_export.h" 14 #include "ui/message_center/message_center_export.h"
11 #include "ui/message_center/notification_list.h" 15 #include "ui/message_center/notification_list.h"
12 16
13 namespace message_center { 17 namespace message_center {
14 18
15 class PopupBubbleContentsView; 19 class PopupBubbleContentsView;
16 20
17 // Bubble for popup notifications. 21 // Bubble for popup notifications.
18 class MESSAGE_CENTER_EXPORT MessagePopupBubble : public MessageBubbleBase { 22 class MESSAGE_CENTER_EXPORT MessagePopupBubble : public MessageBubbleBase {
19 public: 23 public:
20 explicit MessagePopupBubble(NotificationList::Delegate* delegate); 24 explicit MessagePopupBubble(NotificationList::Delegate* delegate);
21 25
22 virtual ~MessagePopupBubble(); 26 virtual ~MessagePopupBubble();
23 27
24 // Overridden from MessageBubbleBase. 28 // Overridden from MessageBubbleBase.
25 virtual views::TrayBubbleView::InitParams GetInitParams( 29 virtual views::TrayBubbleView::InitParams GetInitParams(
26 views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE; 30 views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE;
27 virtual void InitializeContents(views::TrayBubbleView* bubble_view) OVERRIDE; 31 virtual void InitializeContents(views::TrayBubbleView* bubble_view) OVERRIDE;
28 virtual void OnBubbleViewDestroyed() OVERRIDE; 32 virtual void OnBubbleViewDestroyed() OVERRIDE;
29 virtual void UpdateBubbleView() OVERRIDE; 33 virtual void UpdateBubbleView() OVERRIDE;
30 virtual void OnMouseEnteredView() OVERRIDE; 34 virtual void OnMouseEnteredView() OVERRIDE;
31 virtual void OnMouseExitedView() OVERRIDE; 35 virtual void OnMouseExitedView() OVERRIDE;
32 36
33 size_t NumMessageViewsForTest() const; 37 size_t NumMessageViewsForTest() const;
34 38
35 private: 39 private:
36 void StartAutoCloseTimer(int priority); 40 class AutocloseTimer;
37 void StopAutoCloseTimer();
38 41
39 void OnAutoClose(int priority); 42 void OnAutoClose(const std::string& id);
40 43
41 base::OneShotTimer<MessagePopupBubble> autoclose_default_; 44 void DeleteTimer(const std::string& id);
42 base::OneShotTimer<MessagePopupBubble> autoclose_high_; 45
46 std::map<std::string, AutocloseTimer*> autoclose_timers_;
43 PopupBubbleContentsView* contents_view_; 47 PopupBubbleContentsView* contents_view_;
44 NotificationList::Notifications popup_notifications_; 48 std::set<std::string> popup_ids_;
45 bool should_run_default_timer_;
46 bool should_run_high_timer_;
47 49
48 DISALLOW_COPY_AND_ASSIGN(MessagePopupBubble); 50 DISALLOW_COPY_AND_ASSIGN(MessagePopupBubble);
49 }; 51 };
50 52
51 } // namespace message_center 53 } // namespace message_center
52 54
53 #endif // UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_ 55 #endif // UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/message_popup_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698