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 #include <deque> | 5 #include <deque> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void SetNotificationsEnabled(bool enabled) { | 63 void SetNotificationsEnabled(bool enabled) { |
64 if (notifications_enabled_ != enabled) { | 64 if (notifications_enabled_ != enabled) { |
65 notifications_enabled_ = enabled; | 65 notifications_enabled_ = enabled; |
66 NotifyBlockingStateChanged(); | 66 NotifyBlockingStateChanged(); |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 // NotificationBlocker overrides: | 70 // NotificationBlocker overrides: |
71 bool ShouldShowNotificationAsPopup( | 71 bool ShouldShowNotificationAsPopup( |
72 const message_center::NotifierId& notifier_id) const override { | 72 const message_center::Notification& notification) const override { |
73 return notifications_enabled_; | 73 return notifications_enabled_; |
74 } | 74 } |
75 | 75 |
76 private: | 76 private: |
77 bool notifications_enabled_; | 77 bool notifications_enabled_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(ToggledNotificationBlocker); | 79 DISALLOW_COPY_AND_ASSIGN(ToggledNotificationBlocker); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace | 82 } // namespace |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 true); // by_user | 876 true); // by_user |
877 | 877 |
878 ASSERT_EQ(0, GetNotificationCount()); | 878 ASSERT_EQ(0, GetNotificationCount()); |
879 | 879 |
880 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did | 880 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did |
881 // crash. Work around this timing issue by creating another notification, | 881 // crash. Work around this timing issue by creating another notification, |
882 // which requires interaction with the renderer process. | 882 // which requires interaction with the renderer process. |
883 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); | 883 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); |
884 EXPECT_NE("-1", result); | 884 EXPECT_NE("-1", result); |
885 } | 885 } |
OLD | NEW |