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 "chrome/browser/notifications/notification_test_util.h" | 5 #include "chrome/browser/notifications/notification_test_util.h" |
6 | 6 |
7 MockNotificationDelegate::MockNotificationDelegate(const std::string& id) | 7 MockNotificationDelegate::MockNotificationDelegate(const std::string& id) |
8 : id_(id) {} | 8 : id_(id) {} |
9 | 9 |
10 MockNotificationDelegate::~MockNotificationDelegate() {} | 10 MockNotificationDelegate::~MockNotificationDelegate() {} |
11 | 11 |
12 std::string MockNotificationDelegate::id() const { return id_; } | 12 std::string MockNotificationDelegate::id() const { return id_; } |
13 | 13 |
14 content::WebContents* MockNotificationDelegate::GetWebContents() const { | |
15 return NULL; | |
16 } | |
17 | |
18 StubNotificationUIManager::StubNotificationUIManager(const GURL& welcome_origin) | 14 StubNotificationUIManager::StubNotificationUIManager(const GURL& welcome_origin) |
19 : notification_(GURL(), | 15 : notification_(message_center::NOTIFICATION_TYPE_SIMPLE, |
20 gfx::Image(), | 16 GURL(), |
21 base::string16(), | 17 base::string16(), |
22 base::string16(), | 18 base::string16(), |
| 19 gfx::Image(), |
23 blink::WebTextDirectionDefault, | 20 blink::WebTextDirectionDefault, |
| 21 message_center::NotifierId(), |
24 base::string16(), | 22 base::string16(), |
25 base::string16(), | 23 base::string16(), |
| 24 message_center::RichNotificationData(), |
26 new MockNotificationDelegate("stub")), | 25 new MockNotificationDelegate("stub")), |
27 welcome_origin_(welcome_origin), | 26 welcome_origin_(welcome_origin), |
28 welcomed_(false), | 27 welcomed_(false), |
29 added_notifications_(0U) {} | 28 added_notifications_(0U) {} |
30 | 29 |
31 StubNotificationUIManager::~StubNotificationUIManager() {} | 30 StubNotificationUIManager::~StubNotificationUIManager() {} |
32 | 31 |
33 void StubNotificationUIManager::Add(const Notification& notification, | 32 void StubNotificationUIManager::Add(const Notification& notification, |
34 Profile* profile) { | 33 Profile* profile) { |
35 // Make a deep copy of the notification that we can inspect. | 34 // Make a deep copy of the notification that we can inspect. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool StubNotificationUIManager::CancelAllBySourceOrigin( | 71 bool StubNotificationUIManager::CancelAllBySourceOrigin( |
73 const GURL& source_origin) { | 72 const GURL& source_origin) { |
74 return false; | 73 return false; |
75 } | 74 } |
76 | 75 |
77 bool StubNotificationUIManager::CancelAllByProfile(Profile* profile) { | 76 bool StubNotificationUIManager::CancelAllByProfile(Profile* profile) { |
78 return false; | 77 return false; |
79 } | 78 } |
80 | 79 |
81 void StubNotificationUIManager::CancelAll() {} | 80 void StubNotificationUIManager::CancelAll() {} |
OLD | NEW |