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

Side by Side Diff: chrome/browser/notifications/notification_interactive_uitest.cc

Issue 2198363002: Pass Notification into NotificationBlocker ShouldShow* methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ash build errors Created 4 years, 4 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
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 #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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698