OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Draws the view for the balloons. | 5 // Draws the view for the balloons. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_ |
8 #define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_ | 8 #define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_ |
9 | 9 |
10 #include "app/menus/simple_menu_model.h" | 10 #include "app/menus/simple_menu_model.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // True if the notification is stale. False if the notification is new. | 59 // True if the notification is stale. False if the notification is new. |
60 bool stale() const { return stale_; } | 60 bool stale() const { return stale_; } |
61 | 61 |
62 // Makes the notification stale. | 62 // Makes the notification stale. |
63 void set_stale() { stale_ = true; } | 63 void set_stale() { stale_ = true; } |
64 | 64 |
65 // True if the notification is sticky. | 65 // True if the notification is sticky. |
66 bool sticky() { return sticky_; } | 66 bool sticky() { return sticky_; } |
67 | 67 |
68 // True if the notification is closed by the dismiss button. | |
69 bool closed_by_user() { return closed_by_user_; } | |
70 | |
71 private: | 68 private: |
72 // views::View interface. | 69 // views::View interface. |
73 virtual gfx::Size GetPreferredSize() { | 70 virtual gfx::Size GetPreferredSize() { |
74 return gfx::Size(1000, 1000); | 71 return gfx::Size(1000, 1000); |
75 } | 72 } |
76 | 73 |
77 // views::ViewMenuDelegate interface. | 74 // views::ViewMenuDelegate interface. |
78 virtual void RunMenu(views::View* source, const gfx::Point& pt); | 75 virtual void RunMenu(views::View* source, const gfx::Point& pt); |
79 | 76 |
80 // views::ButtonListener interface. | 77 // views::ButtonListener interface. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // The options menu. | 113 // The options menu. |
117 scoped_ptr<menus::SimpleMenuModel> options_menu_contents_; | 114 scoped_ptr<menus::SimpleMenuModel> options_menu_contents_; |
118 scoped_ptr<views::Menu2> options_menu_menu_; | 115 scoped_ptr<views::Menu2> options_menu_menu_; |
119 views::MenuButton* options_menu_button_; | 116 views::MenuButton* options_menu_button_; |
120 bool stale_; | 117 bool stale_; |
121 NotificationRegistrar notification_registrar_; | 118 NotificationRegistrar notification_registrar_; |
122 // A sticky flag. A sticky notification cannot be dismissed by a user. | 119 // A sticky flag. A sticky notification cannot be dismissed by a user. |
123 bool sticky_; | 120 bool sticky_; |
124 // True if a notification should have info/option/dismiss label/buttons. | 121 // True if a notification should have info/option/dismiss label/buttons. |
125 bool controls_; | 122 bool controls_; |
126 // True if the notification is closed by the dismiss button. | |
127 bool closed_by_user_; | |
128 | 123 |
129 DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl); | 124 DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl); |
130 }; | 125 }; |
131 | 126 |
132 } // namespace chromeos | 127 } // namespace chromeos |
133 | 128 |
134 #endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_ | 129 #endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_ |
OLD | NEW |