OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/drive/drive_notification_manager.h" | 5 #include "chrome/browser/drive/drive_notification_manager.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/drive/drive_notification_observer.h" | 8 #include "chrome/browser/drive/drive_notification_observer.h" |
9 #include "chrome/browser/invalidation/invalidation_service.h" | 9 #include "chrome/browser/invalidation/invalidation_service.h" |
10 #include "chrome/browser/invalidation/invalidation_service_factory.h" | 10 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 kDriveInvalidationObjectId); | 76 kDriveInvalidationObjectId); |
77 DCHECK_EQ(1U, ids.count(object_id)); | 77 DCHECK_EQ(1U, ids.count(object_id)); |
78 | 78 |
79 // This effectively disables 'local acks'. It tells the invalidations system | 79 // This effectively disables 'local acks'. It tells the invalidations system |
80 // to not bother saving invalidations across restarts for us. | 80 // to not bother saving invalidations across restarts for us. |
81 // See crbug.com/320878. | 81 // See crbug.com/320878. |
82 invalidation_map.AcknowledgeAll(); | 82 invalidation_map.AcknowledgeAll(); |
83 NotifyObserversToUpdate(NOTIFICATION_XMPP); | 83 NotifyObserversToUpdate(NOTIFICATION_XMPP); |
84 } | 84 } |
85 | 85 |
| 86 std::string DriveNotificationManager::GetOwnerName() const { return "Drive"; } |
| 87 |
86 void DriveNotificationManager::AddObserver( | 88 void DriveNotificationManager::AddObserver( |
87 DriveNotificationObserver* observer) { | 89 DriveNotificationObserver* observer) { |
88 observers_.AddObserver(observer); | 90 observers_.AddObserver(observer); |
89 } | 91 } |
90 | 92 |
91 void DriveNotificationManager::RemoveObserver( | 93 void DriveNotificationManager::RemoveObserver( |
92 DriveNotificationObserver* observer) { | 94 DriveNotificationObserver* observer) { |
93 observers_.RemoveObserver(observer); | 95 observers_.RemoveObserver(observer); |
94 } | 96 } |
95 | 97 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 return "NOTIFICATION_XMPP"; | 152 return "NOTIFICATION_XMPP"; |
151 case NOTIFICATION_POLLING: | 153 case NOTIFICATION_POLLING: |
152 return "NOTIFICATION_POLLING"; | 154 return "NOTIFICATION_POLLING"; |
153 } | 155 } |
154 | 156 |
155 NOTREACHED(); | 157 NOTREACHED(); |
156 return ""; | 158 return ""; |
157 } | 159 } |
158 | 160 |
159 } // namespace drive | 161 } // namespace drive |
OLD | NEW |