| 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 "base/memory/scoped_nsobject.h" | 5 #include "base/memory/scoped_nsobject.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/notifications/balloon.h" | 7 #include "chrome/browser/notifications/balloon.h" |
| 8 #include "chrome/browser/notifications/balloon_collection.h" | 8 #include "chrome/browser/notifications/balloon_collection.h" |
| 9 #include "chrome/browser/notifications/notification.h" | 9 #include "chrome/browser/notifications/notification.h" |
| 10 #include "chrome/browser/notifications/notification_object_proxy.h" | 10 #include "chrome/browser/notifications/notification_object_proxy.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 @end | 29 @end |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // Use a dummy balloon collection for testing. | 33 // Use a dummy balloon collection for testing. |
| 34 class MockBalloonCollection : public BalloonCollection { | 34 class MockBalloonCollection : public BalloonCollection { |
| 35 virtual void Add(const Notification& notification, | 35 virtual void Add(const Notification& notification, |
| 36 Profile* profile) {} | 36 Profile* profile) {} |
| 37 virtual bool RemoveById(const std::string& id) { return false; } | 37 virtual bool RemoveById(const std::string& id) { return false; } |
| 38 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; } | 38 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; } |
| 39 virtual bool RemoveByProfile(Profile* profile) { return false; } |
| 39 virtual void RemoveAll() {} | 40 virtual void RemoveAll() {} |
| 40 virtual bool HasSpace() const { return true; } | 41 virtual bool HasSpace() const { return true; } |
| 41 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {} | 42 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {} |
| 42 virtual void DisplayChanged() {} | 43 virtual void DisplayChanged() {} |
| 43 virtual void SetPositionPreference(PositionPreference preference) {} | 44 virtual void SetPositionPreference(PositionPreference preference) {} |
| 44 virtual void OnBalloonClosed(Balloon* source) {}; | 45 virtual void OnBalloonClosed(Balloon* source) {}; |
| 45 virtual const Balloons& GetActiveBalloons() { | 46 virtual const Balloons& GetActiveBalloons() { |
| 46 NOTREACHED(); | 47 NOTREACHED(); |
| 47 return balloons_; | 48 return balloons_; |
| 48 } | 49 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 113 |
| 113 [controller showWindow:nil]; | 114 [controller showWindow:nil]; |
| 114 | 115 |
| 115 EXPECT_TRUE([controller desiredTotalWidth] > 100); | 116 EXPECT_TRUE([controller desiredTotalWidth] > 100); |
| 116 EXPECT_TRUE([controller desiredTotalHeight] > 100); | 117 EXPECT_TRUE([controller desiredTotalHeight] > 100); |
| 117 | 118 |
| 118 [controller closeBalloon:YES]; | 119 [controller closeBalloon:YES]; |
| 119 } | 120 } |
| 120 | 121 |
| 121 } | 122 } |
| OLD | NEW |