| 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/sync/glue/chrome_sync_notification_bridge.h" | 5 #include "chrome/browser/sync/glue/chrome_sync_notification_bridge.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 notification_count_++; | 63 notification_count_++; |
| 64 if (source != sync_notifier::LOCAL_NOTIFICATION) { | 64 if (source != sync_notifier::LOCAL_NOTIFICATION) { |
| 65 LOG(ERROR) << "Received notification with wrong source."; | 65 LOG(ERROR) << "Received notification with wrong source."; |
| 66 received_improper_notification_ = true; | 66 received_improper_notification_ = true; |
| 67 } | 67 } |
| 68 if (expected_payloads_ != type_payloads) { | 68 if (expected_payloads_ != type_payloads) { |
| 69 LOG(ERROR) << "Received wrong payload."; | 69 LOG(ERROR) << "Received wrong payload."; |
| 70 received_improper_notification_ = true; | 70 received_improper_notification_ = true; |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 virtual void OnNotificationStateChange(bool notifications_enabled) { | 73 virtual void OnNotificationsEnabled() OVERRIDE { |
| 74 NOTREACHED(); |
| 75 } |
| 76 virtual void OnNotificationsDisabled( |
| 77 sync_notifier::NotificationsDisabledReason reason) OVERRIDE { |
| 74 NOTREACHED(); | 78 NOTREACHED(); |
| 75 } | 79 } |
| 76 | 80 |
| 77 bool ReceivedProperNotification() const { | 81 bool ReceivedProperNotification() const { |
| 78 return (notification_count_ == 1) && !received_improper_notification_; | 82 return (notification_count_ == 1) && !received_improper_notification_; |
| 79 } | 83 } |
| 80 | 84 |
| 81 private: | 85 private: |
| 82 ChromeSyncNotificationBridge* bridge_; | 86 ChromeSyncNotificationBridge* bridge_; |
| 83 bool received_improper_notification_; | 87 bool received_improper_notification_; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 syncable::ModelTypePayloadMap payload_map; | 271 syncable::ModelTypePayloadMap payload_map; |
| 268 payload_map[syncable::SESSIONS] = ""; | 272 payload_map[syncable::SESSIONS] = ""; |
| 269 CreateObserverWithExpectedPayload(payload_map); | 273 CreateObserverWithExpectedPayload(payload_map); |
| 270 TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, | 274 TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, |
| 271 payload_map); | 275 payload_map); |
| 272 VerifyAndDestroyObserver(); | 276 VerifyAndDestroyObserver(); |
| 273 } | 277 } |
| 274 | 278 |
| 275 } // namespace | 279 } // namespace |
| 276 } // namespace browser_sync | 280 } // namespace browser_sync |
| OLD | NEW |