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 #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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/notifications/notification_object_proxy.h" | 11 #include "chrome/browser/notifications/notification_object_proxy.h" |
12 #include "chrome/browser/notifications/balloon.h" | 12 #include "chrome/browser/notifications/balloon.h" |
13 #include "gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 // NotificationDelegate which does nothing, useful for testing when | 15 // NotificationDelegate which does nothing, useful for testing when |
16 // the notification events are not important. | 16 // the notification events are not important. |
17 class MockNotificationDelegate : public NotificationDelegate { | 17 class MockNotificationDelegate : public NotificationDelegate { |
18 public: | 18 public: |
19 explicit MockNotificationDelegate(const std::string& id) : id_(id) {} | 19 explicit MockNotificationDelegate(const std::string& id) : id_(id) {} |
20 virtual ~MockNotificationDelegate() {} | 20 virtual ~MockNotificationDelegate() {} |
21 | 21 |
22 // NotificationDelegate interface. | 22 // NotificationDelegate interface. |
23 virtual void Display() {} | 23 virtual void Display() {} |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void Close(bool by_user) { balloon_->OnClose(by_user); } | 83 void Close(bool by_user) { balloon_->OnClose(by_user); } |
84 gfx::Size GetSize() const { return balloon_->content_size(); } | 84 gfx::Size GetSize() const { return balloon_->content_size(); } |
85 BalloonHost* GetHost() const { return NULL; } | 85 BalloonHost* GetHost() const { return NULL; } |
86 | 86 |
87 private: | 87 private: |
88 // Non-owned pointer. | 88 // Non-owned pointer. |
89 Balloon* balloon_; | 89 Balloon* balloon_; |
90 }; | 90 }; |
91 | 91 |
92 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 92 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
OLD | NEW |