| OLD | NEW |
| 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 ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 5 #ifndef ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
| 6 #define ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 6 #define ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/system/tray/tray_background_view.h" | 9 #include "ash/system/tray/tray_background_view.h" |
| 10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Disable all notifications matching notification |id|. | 132 // Disable all notifications matching notification |id|. |
| 133 void DisableByExtension(const std::string& id); | 133 void DisableByExtension(const std::string& id); |
| 134 void DisableByUrl(const std::string& id); | 134 void DisableByUrl(const std::string& id); |
| 135 | 135 |
| 136 // Request the Delegate to the settings dialog. | 136 // Request the Delegate to the settings dialog. |
| 137 void ShowSettings(const std::string& id); | 137 void ShowSettings(const std::string& id); |
| 138 | 138 |
| 139 // Called when a notification is clicked on. Event is passed to the Delegate. | 139 // Called when a notification is clicked on. Event is passed to the Delegate. |
| 140 void OnClicked(const std::string& id); | 140 void OnClicked(const std::string& id); |
| 141 | 141 |
| 142 bool menu_open() const { return menu_open_; } |
| 143 void set_menu_open(bool menu_open) { menu_open_ = menu_open; } |
| 144 |
| 142 private: | 145 private: |
| 143 class Bubble; | 146 class Bubble; |
| 144 friend class internal::WebNotificationButtonView; | 147 friend class internal::WebNotificationButtonView; |
| 145 friend class internal::WebNotificationMenuModel; | 148 friend class internal::WebNotificationMenuModel; |
| 149 friend class internal::WebNotificationList; |
| 146 friend class internal::WebNotificationView; | 150 friend class internal::WebNotificationView; |
| 147 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); | 151 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); |
| 148 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationBubble); | 152 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationBubble); |
| 149 | 153 |
| 150 int GetNotificationCount() const; | 154 int GetNotificationCount() const; |
| 151 void UpdateTray(); | 155 void UpdateTray(); |
| 152 void UpdateTrayAndBubble(); | 156 void UpdateTrayAndBubble(); |
| 153 void HideBubble(Bubble* bubble); | 157 void HideBubble(Bubble* bubble); |
| 154 bool HasNotificationForTest(const std::string& id) const; | 158 bool HasNotificationForTest(const std::string& id) const; |
| 155 | 159 |
| 156 const internal::WebNotificationList* notification_list() const { | 160 const internal::WebNotificationList* notification_list() const { |
| 157 return notification_list_.get(); | 161 return notification_list_.get(); |
| 158 } | 162 } |
| 159 Bubble* message_center_bubble() const { return message_center_bubble_.get(); } | 163 Bubble* message_center_bubble() const { return message_center_bubble_.get(); } |
| 160 Bubble* notification_bubble() const { return notification_bubble_.get(); } | 164 Bubble* notification_bubble() const { return notification_bubble_.get(); } |
| 161 | 165 |
| 162 scoped_ptr<internal::WebNotificationList> notification_list_; | 166 scoped_ptr<internal::WebNotificationList> notification_list_; |
| 163 scoped_ptr<Bubble> message_center_bubble_; | 167 scoped_ptr<Bubble> message_center_bubble_; |
| 164 scoped_ptr<Bubble> notification_bubble_; | 168 scoped_ptr<Bubble> notification_bubble_; |
| 165 views::Label* count_label_; | 169 views::Label* count_label_; |
| 166 Delegate* delegate_; | 170 Delegate* delegate_; |
| 167 bool show_message_center_on_unlock_; | 171 bool show_message_center_on_unlock_; |
| 172 bool menu_open_; |
| 168 | 173 |
| 169 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 174 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 } // namespace ash | 177 } // namespace ash |
| 173 | 178 |
| 174 #endif // ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 179 #endif // ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
| OLD | NEW |