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 CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 // static void log(string); | 40 // static void log(string); |
41 template<class Logger> | 41 template<class Logger> |
42 class LoggingNotificationDelegate : public NotificationDelegate { | 42 class LoggingNotificationDelegate : public NotificationDelegate { |
43 public: | 43 public: |
44 explicit LoggingNotificationDelegate(std::string id) : notification_id_(id) {} | 44 explicit LoggingNotificationDelegate(std::string id) : notification_id_(id) {} |
45 | 45 |
46 // NotificationObjectProxy override | 46 // NotificationObjectProxy override |
47 virtual void Display() override { | 47 virtual void Display() override { |
48 Logger::log("notification displayed\n"); | 48 Logger::log("notification displayed\n"); |
49 } | 49 } |
50 virtual void Error() override { | |
51 Logger::log("notification error\n"); | |
52 } | |
53 virtual void Click() override { | 50 virtual void Click() override { |
54 Logger::log("notification clicked\n"); | 51 Logger::log("notification clicked\n"); |
55 } | 52 } |
56 virtual void ButtonClick(int index) override { | 53 virtual void ButtonClick(int index) override { |
57 Logger::log("notification button clicked\n"); | 54 Logger::log("notification button clicked\n"); |
58 } | 55 } |
59 virtual void Close(bool by_user) override { | 56 virtual void Close(bool by_user) override { |
60 if (by_user) | 57 if (by_user) |
61 Logger::log("notification closed by user\n"); | 58 Logger::log("notification closed by user\n"); |
62 else | 59 else |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager); | 118 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager); |
122 Notification notification_; | 119 Notification notification_; |
123 Profile* profile_; | 120 Profile* profile_; |
124 std::string dismissed_id_; | 121 std::string dismissed_id_; |
125 GURL welcome_origin_; | 122 GURL welcome_origin_; |
126 bool welcomed_; | 123 bool welcomed_; |
127 size_t added_notifications_; | 124 size_t added_notifications_; |
128 }; | 125 }; |
129 | 126 |
130 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 127 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
OLD | NEW |